diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 06b98ebdb53c96d06bb3297a3253141c5640dab1..0000000000000000000000000000000000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib"] - path = lib - url = https://git.d-logic.com/nfc-rfid-reader-sdk/ufr-lib diff --git a/lib b/lib deleted file mode 160000 index 98bb6a96686e34670fb92caa5b1f7b2bc48a9df4..0000000000000000000000000000000000000000 --- a/lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 98bb6a96686e34670fb92caa5b1f7b2bc48a9df4 diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fb11d4fa79a2bd08dcc12745ec8061fd13e0b2e4 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,52 @@ + +# uFCoder libraries + +Scope of this project are libraries used with **uFR** and **uFR Zero** Series devices and SDK examples. +Libraries are supported at following platforms: +Windows 32 and 64 bit (static and dynamic) +Linux 32 and 64 bit (dynamic & static) +Linux ARM and ARM-HF (dynamic & static) +Mac OSX 64 bit & Universal (dynamic only) +iOS 64 bit (static & framework) +Android ARM 64 bit (.aar) +ESP32 ESP-IDF component + +## Getting Started + +Download project, choose appropriate architecture and place a library in appropriate directory. +Consult documentation for [API reference](https://code.d-logic.com/nfc-rfid-reader-sdk/ufr-doc/-/blob/master/uFR_Series_NFC_reader_API.pdf). For quick insight and functions' prototypes, check **/include/ufCoder.h** header file. + +### Prerequisites + +[**uFR**](https://webshop.d-logic.com/products/nfc-rfid-reader-writer/ufr-series-dev-tools-with-sdk.html) or [**uFR Zero**](https://webshop.d-logic.com/products/nfc-rfid-reader-writer/ufr-zero-series.html) Series reader. + +## License + +See the [uFR_library_license.md](/license/uFR_library_license.md) file for details + +## Acknowledgments + +* Libraries are specific to mentioned hardware ONLY and some other hardware might have different approach, please bear that in mind. + +## Changelog + +### [Version 6.0.9] - 2025-03-05 + +### General Changes + +- **API Updates:** + +- *SetServiceData()* API function call added. + +- *GetServiceData()* API function call added. + + +### Platform-Specific Changes + +#### Android + +- Android library updated to support following function calls on this platform: + +-- *Display_** function calls. + +-- *GetCardManufacturer()* function call. \ No newline at end of file diff --git a/lib/android/uFCoder.aar b/lib/android/uFCoder.aar new file mode 100644 index 0000000000000000000000000000000000000000..334547fe798d089ede3fff0926bd2f5d50b2bf0c Binary files /dev/null and b/lib/android/uFCoder.aar differ diff --git a/lib/android_nexgo/uFCoder.aar b/lib/android_nexgo/uFCoder.aar new file mode 100644 index 0000000000000000000000000000000000000000..99c08de8238fe08e202eae9fe792259a47d833c8 Binary files /dev/null and b/lib/android_nexgo/uFCoder.aar differ diff --git a/lib/android_sunmi/uFCoder.aar b/lib/android_sunmi/uFCoder.aar new file mode 100644 index 0000000000000000000000000000000000000000..59b3ed9a6f3e6f0864a22055092d0f6feba09eb0 Binary files /dev/null and b/lib/android_sunmi/uFCoder.aar differ diff --git a/lib/arduino_ufr/Packet.cpp b/lib/arduino_ufr/Packet.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cc48dbf8586a09a68b78c688dc5f1cdf4fed2588 --- /dev/null +++ b/lib/arduino_ufr/Packet.cpp @@ -0,0 +1,102 @@ +#include "uFR.h" +#ifdef ESP32 +HardwareSerial* uFR::Packet::serial; +#else +SoftwareSerial* uFR::Packet::serial; +#endif + +uFR::CommonPacket::CommonPacket(PacketType type, uint8_t command) { + data = new uint8_t[PACKET_LENGTH]; + errorCode = read(data); + if (errorCode == 0) errorCode = validate(data, type, command); +} +uFR::CommonPacket::~CommonPacket() { + delete[] data; +} + +uFR::EXTPacket::EXTPacket(uint8_t length) { + data = new uint8_t[length]; + errorCode = read(data, length); +} +uFR::EXTPacket::~EXTPacket() { + delete[] data; +} + +uint8_t uFR::Packet::checksum(uint8_t *packet, uint8_t size) { + uint8_t result = packet[0]; + // XOR size bytes + for (uint8_t i = 1; i < size; i++) + result ^= packet[i]; + return result + 0x07; +} + +uint8_t uFR::CommonPacket::validate(uint8_t packet[PACKET_LENGTH], PacketType type, uint8_t command) { + if (checksum(packet) != packet[CHKSUM_BYTE]) return CHKSUM_ERROR_RESPONSE; + if (packet[HEADER_BYTE] == ERR_HEADER) { + if (packet[TRAILER_BYTE] == ERR_TRAILER) return packet[CMD_BYTE]; + return COMMUNICATION_ERROR; + } + if (packet[HEADER_BYTE] != type || packet[CMD_BYTE] != command) return COMMUNICATION_ERROR; + switch (type) { + case PACKET_ACK: + if (packet[TRAILER_BYTE] != ACK_TRAILER) return COMMUNICATION_ERROR; + break; + case PACKET_RSP: + if (packet[TRAILER_BYTE] != RESPONSE_TRAILER) return COMMUNICATION_ERROR; + break; + default: + return COMMUNICATION_ERROR; + } + return 0; +} + +uint8_t uFR::CommonPacket::read(uint8_t response[PACKET_LENGTH]) { + unsigned long time = millis(); + uint8_t incoming = 0; + // Read bytes until header found + while(incoming != ACK_HEADER && incoming != ERR_HEADER && incoming != RESPONSE_HEADER) { + if((unsigned long)(millis() - time) > TIMEOUT_MS) return COMMUNICATION_TIMEOUT; + if (serial->available() > 0) incoming = serial->read(); + } + // Read remaining bytes (PACKET_LENGTH - 1) + while (serial->available() < 6) + if ((unsigned long)(millis() - time) > TIMEOUT_MS) return COMMUNICATION_TIMEOUT; + + // Store bytes + response[0] = incoming; + for (uint8_t i = 1; i < PACKET_LENGTH; i++) + response[i] = serial->read(); + + return 0; +} + +uint8_t uFR::EXTPacket::read(uint8_t *response, uint8_t length) { + unsigned long time = millis(); + uint8_t i = 0; + int b; + // Read length bytes + while (i < length) { + if ((unsigned long)(millis() - time) > TIMEOUT_MS) return COMMUNICATION_TIMEOUT_EXT; + b = serial->read(); + if(b != -1) { + response[i] = b; + i++; + } + } + // Read and check checksum byte (length + 1) + while (serial->available() < 1) + if ((unsigned long)(millis() - time) > TIMEOUT_MS) return COMMUNICATION_TIMEOUT_EXT; + if (serial->read() != checksum(response, length)) return CHKSUM_ERROR_EXT; + + return 0; +} + +void uFR::Packet::copyData(uint8_t *array, uint16_t start, uint16_t length) { + for (uint16_t i = 0; i < length; i++) + array[i + start] = data[i]; +} + +void uFR::Packet::copyDataReverse(uint8_t *array, uint16_t start, uint16_t length) { + for (uint16_t i = 0; i < length; i++) + array[i + start] = data[length - i - 1]; +} \ No newline at end of file diff --git a/lib/arduino_ufr/keywords.txt b/lib/arduino_ufr/keywords.txt new file mode 100644 index 0000000000000000000000000000000000000000..5ab05d0d3530788db9612be50d02944fc1747785 --- /dev/null +++ b/lib/arduino_ufr/keywords.txt @@ -0,0 +1,30 @@ +####################################### +# Syntax Coloring Map For uFR +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +uFR KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +hardReset KEYWORD2 +setRedLED KEYWORD2 +getReaderType KEYWORD2 +getReaderSerial KEYWORD2 +setReaderKey KEYWORD2 +getUserData KEYWORD2 +setUserData KEYWORD2 +softReset KEYWORD2 +getCardIDSimple KEYWORD2 +getCardID KEYWORD2 +getCardTypeDLogic KEYWORD2 +TypeDLogicToString KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### \ No newline at end of file diff --git a/lib/arduino_ufr/uFR.cpp b/lib/arduino_ufr/uFR.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df54c59aaf304193f35d35c58773c349e0b2e2f8 --- /dev/null +++ b/lib/arduino_ufr/uFR.cpp @@ -0,0 +1,347 @@ +#include "uFR.h" + +#define PROCESS_EXT(length) \ +EXTPacket extPacket(length); \ +if (extPacket.getErrorCode() != 0) return extPacket.getErrorCode() + +#define PROCESS_ACK(command) \ +CommonPacket ackPacket(PACKET_ACK, command); \ +if (ackPacket.getErrorCode() != 0) return ackPacket.getErrorCode() + +#define PROCESS_RSP(command) \ +CommonPacket rspPacket(PACKET_RSP, command); \ +if (rspPacket.getErrorCode() != 0) return rspPacket.getErrorCode() + +#ifdef ESP32 +uFR::uFR(uint8_t uart) : readerSerial(HardwareSerial(uart)) { + setPacketSerial(); +} + +uFR::uFR(uint8_t uart, uint8_t rx_pin, uint8_t tx_pin) : readerSerial(HardwareSerial(uart)) { + esp32_rx_pin = rx_pin; + esp32_tx_pin = tx_pin; + setPacketSerial(); +} + +uFR::uFR(uint8_t uart, uint8_t reset) : readerSerial(HardwareSerial(uart)) { + pinMode(reset, OUTPUT); + digitalWrite(reset, HIGH); + resetPin = reset; + setPacketSerial(); +} + +uFR::uFR(uint8_t uart, uint8_t reset, uint8_t rx_pin, uint8_t tx_pin) : readerSerial(HardwareSerial(uart)) { + pinMode(reset, OUTPUT); + digitalWrite(reset, HIGH); + resetPin = reset; + esp32_rx_pin = rx_pin; + esp32_tx_pin = tx_pin; + setPacketSerial(); +} + +#else + uFR::uFR(uint8_t rx, uint8_t tx) : readerSerial(SoftwareSerial(rx, tx)) { + setPacketSerial(); +} + +uFR::uFR(uint8_t rx, uint8_t tx, uint8_t reset) : readerSerial(SoftwareSerial(rx, tx)) { + pinMode(reset, OUTPUT); + digitalWrite(reset, HIGH); + resetPin = reset; + setPacketSerial(); +} +#endif + +void uFR::setPacketSerial() { + Packet::serial = &readerSerial; +} + +void uFR::begin(unsigned long baud) { + if(resetPin != 0) { + delay(10); + digitalWrite(resetPin, LOW); + } + #ifdef ESP32 + if(esp32_rx_pin != 0 && esp32_tx_pin != 0) { + readerSerial.begin(baud, SERIAL_8N1, esp32_rx_pin, esp32_tx_pin); + } + else + { + readerSerial.begin(baud); + } + #else + readerSerial.begin(baud); + #endif + +} + +void uFR::hardReset() { + if (resetPin != 0) { + digitalWrite(resetPin, HIGH); + delay(10); + digitalWrite(resetPin, LOW); + } +} + +void uFR::flushSerial() { + while (readerSerial.available() > 0) + readerSerial.read(); +} + +void uFR::sendPacketCMD(uint8_t command, uint8_t EXTlength, uint8_t par0, uint8_t par1) { + uint8_t packet[PACKET_LENGTH] = { + CMD_HEADER, + command, + CMD_TRAILER, + EXTlength, + par0, + par1, + Packet::checksum(packet) + }; + readerSerial.write(packet, PACKET_LENGTH); +} + +void uFR::sendPacketEXT(uint8_t *packet, uint8_t length) { + readerSerial.write(packet, length); + readerSerial.write(Packet::checksum(packet, length)); +} + +// ======================================================================================== + +uint8_t uFR::setRedLED(bool state) { + flushSerial(); + sendPacketCMD(RED_LIGHT_CONTROL, 0, state); + PROCESS_RSP(RED_LIGHT_CONTROL); + return 0; +} + +uint8_t uFR::setUserInterfaceSignal(uint8_t light_signal_mode, uint8_t beep_signal_mode) { + flushSerial(); + sendPacketCMD(USER_INTERFACE_SIGNAL, 0, light_signal_mode, beep_signal_mode); + PROCESS_RSP(USER_INTERFACE_SIGNAL); + return 0; +} + +uint8_t uFR::setGreenLightBlinking(bool state) { + flushSerial(); + sendPacketCMD(SET_LED_CONFIG, 0, state); + PROCESS_RSP(SET_LED_CONFIG); + return 0; +} + + + +uint8_t uFR::getReaderType(uint8_t readerType[READER_TYPE_SIZE]) { + flushSerial(); + sendPacketCMD(GET_READER_TYPE); + PROCESS_RSP(GET_READER_TYPE); + PROCESS_EXT(READER_TYPE_SIZE); + extPacket.copyDataReverse(readerType, 0, READER_TYPE_SIZE); + return 0; +} + +uint8_t uFR::getReaderSerial(uint8_t readerSerialNumber[READER_SERIAL_SIZE]) { + flushSerial(); + sendPacketCMD(GET_READER_SERIAL); + PROCESS_RSP(GET_READER_SERIAL); + PROCESS_EXT(READER_SERIAL_SIZE); + extPacket.copyDataReverse(readerSerialNumber, 0, READER_SERIAL_SIZE); + return 0; +} + +uint8_t uFR::setReaderKey(uint8_t key[READER_KEY_SIZE], uint8_t index) { + flushSerial(); + sendPacketCMD(READER_KEY_WRITE, READER_KEY_SIZE + 1, index); + PROCESS_ACK(READER_KEY_WRITE); + sendPacketEXT(key, READER_KEY_SIZE); + PROCESS_RSP(READER_KEY_WRITE); + return 0; +} + +uint8_t uFR::getUserData(uint8_t data[USER_DATA_SIZE]) { + flushSerial(); + sendPacketCMD(USER_DATA_READ); + PROCESS_RSP(USER_DATA_READ); + PROCESS_EXT(USER_DATA_SIZE); + extPacket.copyData(data, 0, USER_DATA_SIZE); + return 0; +} + +uint8_t uFR::setUserData(uint8_t data[USER_DATA_SIZE]) { + flushSerial(); + sendPacketCMD(USER_DATA_WRITE, USER_DATA_SIZE + 1); + PROCESS_ACK(USER_DATA_WRITE); + sendPacketEXT(data, USER_DATA_SIZE); + PROCESS_RSP(USER_DATA_WRITE); + return 0; +} + +uint8_t uFR::softReset() { + flushSerial(); + sendPacketCMD(SELF_RESET); + PROCESS_RSP(SELF_RESET); + return 0; +} + +uint8_t uFR::getCardIDSimple(uint8_t cardID[CARD_ID_SIZE], uint8_t *cardType) { + flushSerial(); + sendPacketCMD(GET_CARD_ID); + PROCESS_RSP(GET_CARD_ID); + PROCESS_EXT(CARD_ID_SIZE); + extPacket.copyDataReverse(cardID, 0, CARD_ID_SIZE); + if (cardType) *cardType = rspPacket[PAR0_BYTE]; + return 0; +} + +uint8_t uFR::getCardID(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length, uint8_t *cardType) { + flushSerial(); + sendPacketCMD(GET_CARD_ID_EX); + PROCESS_RSP(GET_CARD_ID_EX); + PROCESS_EXT(CARD_ID_EX_SIZE); + //extPacket.copyDataReverse(cardID, 0, rspPacket[PAR1_BYTE]); + //extPacket.copyData is used to make the order of bytes of cardID as on the card + extPacket.copyData(cardID, 0, rspPacket[PAR1_BYTE]); + if (cardType) *cardType = rspPacket[PAR0_BYTE]; + if (length) *length = rspPacket[PAR1_BYTE]; + return 0; +} + +uint8_t uFR::getDesfireUID(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length, uint8_t InternalAESKeyIndexReader, uint32_t AID, uint8_t key_number_in_application) { + uint8_t desfire_uid_size = 7; //as I can see in protocol, there are no length definitions. UID is always 7B. + *length = desfire_uid_size; + uint8_t data_to_send[22]; + memset(data_to_send, 0, 22); + data_to_send[0]=1; + data_to_send[1]=InternalAESKeyIndexReader; + data_to_send[18] = *((uint8_t *)&AID); + data_to_send[19] = *((uint8_t *)&AID+1); + data_to_send[20] = *((uint8_t *)&AID+2); + data_to_send[21]= key_number_in_application; + +/* + Serial.print("data_to_send = "); + for(int i;i<22;i++) + { + Serial.print(data_to_send[i], HEX); + Serial.print(" "); + } + Serial.print("\n"); +*/ + + flushSerial(); + sendPacketCMD(GET_DESFIRE_UID, 23); + PROCESS_ACK(GET_DESFIRE_UID); + sendPacketEXT(data_to_send, 22); + PROCESS_RSP(GET_DESFIRE_UID); +/* + Serial.print("RSP:"); + for(int i;i<7;++i) + { + Serial.print(rspPacket[i], HEX); + Serial.print(" "); + } + Serial.print("\n"); + +*/ + if(rspPacket[3]!=12) + { + return PARAMETERS_ERROR; + } + PROCESS_EXT(11); + extPacket.copyData(cardID, 0, desfire_uid_size); + return 0; +} + +uint8_t uFR::getDesfireUIDPK(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length, uint8_t *AESKey, uint32_t AID, uint8_t key_number_in_application) { + uint8_t desfire_uid_size = 7; //as I can see in protocol, there are no length definitions. UID is always 7B. + *length = desfire_uid_size; + uint8_t data_to_send[22]; + memset(data_to_send, 0, 22); + data_to_send[0]=0; + data_to_send[1]=0; + memcpy(&data_to_send[2], AESKey, 16); + data_to_send[18] = *((uint8_t *)&AID); + data_to_send[19] = *((uint8_t *)&AID+1); + data_to_send[20] = *((uint8_t *)&AID+2); + data_to_send[21]= key_number_in_application; + +/* + Serial.print("data_to_send = "); + for(int i;i<22;i++) + { + Serial.print(data_to_send[i], HEX); + Serial.print(" "); + } + Serial.print("\n"); +*/ + + flushSerial(); + sendPacketCMD(GET_DESFIRE_UID, 23); + PROCESS_ACK(GET_DESFIRE_UID); + sendPacketEXT(data_to_send, 22); + PROCESS_RSP(GET_DESFIRE_UID); +/* + Serial.print("RSP:"); + for(int i;i<7;++i) + { + Serial.print(rspPacket[i], HEX); + Serial.print(" "); + } + Serial.print("\n"); + +*/ + if(rspPacket[3]!=12) + { + return PARAMETERS_ERROR; + } + PROCESS_EXT(11); + extPacket.copyData(cardID, 0, desfire_uid_size); + return 0; +} + +uint8_t uFR::getCardTypeDLogic(uint8_t *cardType) { + flushSerial(); + sendPacketCMD(GET_DLOGIC_CARD_TYPE); + PROCESS_RSP(GET_DLOGIC_CARD_TYPE); + *cardType = rspPacket[PAR0_BYTE]; + return 0; +} + +// ======================================================================================== + +// Needs beautifying +const char * TypeDLogicToString(uint8_t type) { + switch (type) { + case 0x00: return "TAG_UNKNOWN"; break; + case 0x01: return "DL_MIFARE_ULTRALIGHT"; break; + case 0x02: return "DL_MIFARE_ULTRALIGHT_EV1_11"; break; + case 0x03: return "DL_MIFARE_ULTRALIGHT_EV1_21"; break; + case 0x04: return "DL_MIFARE_ULTRALIGHT_C"; break; + case 0x05: return "DL_NTAG_203"; break; + case 0x06: return "DL_NTAG_210"; break; + case 0x07: return "DL_NTAG_212"; break; + case 0x08: return "DL_NTAG_213"; break; + case 0x09: return "DL_NTAG_215"; break; + case 0x0A: return "DL_NTAG_216"; break; + case 0x0B: return "DL_MIKRON_MIK640D"; break; + case 0x0C: return "NFC_T2T_GENERIC"; break; + case 0x20: return "DL_MIFARE_MINI"; break; + case 0x21: return "DL_MIFARE_CLASSIC_1K"; break; + case 0x22: return "DL_MIFARE_CLASSIC_4K"; break; + case 0x23: return "DL_MIFARE_PLUS_S_2K"; break; + case 0x24: return "DL_MIFARE_PLUS_S_4K"; break; + case 0x25: return "DL_MIFARE_PLUS_X_2K"; break; + case 0x26: return "DL_MIFARE_PLUS_X_4K"; break; + case 0x27: return "DL_MIFARE_DESFIRE"; break; + case 0x28: return "DL_MIFARE_DESFIRE_EV1_2K"; break; + case 0x29: return "DL_MIFARE_DESFIRE_EV1_4K"; break; + case 0x2A: return "DL_MIFARE_DESFIRE_EV1_8K"; break; + case 0x2B: return "DL_MIFARE_DESFIRE_EV2_2K"; break; + case 0x2C: return "DL_MIFARE_DESFIRE_EV2_4K"; break; + case 0x2D: return "DL_MIFARE_DESFIRE_EV2_8K"; break; + case 0x40: return "DL_GENERIC_ISO14443_4"; break; + case 0x41: return "DL_GENERIC_ISO14443_TYPE_B"; break; + case 0x80: return "DL_IMEI_UID"; break; + default: return "TYPE_ERROR"; + } +} diff --git a/lib/arduino_ufr/uFR.h b/lib/arduino_ufr/uFR.h new file mode 100644 index 0000000000000000000000000000000000000000..d01f90b4a28daa16dbe027d56426a2b2095dbb60 --- /dev/null +++ b/lib/arduino_ufr/uFR.h @@ -0,0 +1,284 @@ +/// Digital Logic uFR NFC card reader library for Arduino +/// +/// Based on IS21 DLogic serial communication protocol +/// +/// Version: 1.0.0 +/// 2018 Marko Djordjevic + + +#include +#ifdef ESP32 +#include +#else +#include +#endif + +#define TIMEOUT_MS 100 // Debugging + +// Communication constants +#define MAX_PACKET_LENGTH 64 +#define HEADER_BYTE 0 +#define CMD_BYTE 1 +#define TRAILER_BYTE 2 +#define EXT_LENGTH_BYTE 3 +#define PAR0_BYTE 4 +#define PAR1_BYTE 5 +#define CHKSUM_BYTE 6 +#define PACKET_LENGTH 7 +#define CMD_HEADER 0x55 +#define ACK_HEADER 0xAC +#define RESPONSE_HEADER 0xDE +#define ERR_HEADER 0xEC +#define CMD_TRAILER 0xAA +#define ACK_TRAILER 0xCA +#define RESPONSE_TRAILER 0xED +#define ERR_TRAILER 0xCE + +// CMD codes +#define GET_READER_TYPE 0x10 +#define GET_READER_SERIAL 0x11 +#define READER_KEY_WRITE 0x12 +#define GET_CARD_ID 0x13 +#define LINEAR_READ 0x14 +#define LINEAR_WRITE 0x15 +#define BLOCK_READ 0x16 +#define BLOCK_WRITE 0x17 +#define BLOCK_IN_SECTOR_READ 0x18 +#define BLOCK_IN_SECTOR_WRITE 0x19 +#define SECTOR_TRAILER_WRITE 0X1A +#define USER_DATA_READ 0x1B +#define USER_DATA_WRITE 0x1C +#define VALUE_BLOCK_READ 0x1D +#define VALUE_BLOCK_WRITE 0x1E +#define VALUE_BLOCK_IN_SECTOR_READ 0x1F +#define VALUE_BLOCK_IN_SECTOR_WRITE 0x20 +#define VALUE_BLOCK_INC 0x21 +#define VALUE_BLOCK_DEC 0x22 +#define VALUE_BLOCK_IN_SECTOR_INC 0x23 +#define VALUE_BLOCK_IN_SECTOR_DEC 0x24 +#define LINEAR_FORMAT_CARD 0x25 +#define USER_INTERFACE_SIGNAL 0x26 +#define GET_CARD_ID_EX 0x2C +#define SECTOR_TRAILER_WRITE_UNSAFE 0x2F +#define SELF_RESET 0x30 +#define GET_DLOGIC_CARD_TYPE 0x3C +#define SET_CARD_ID_SEND_CONF 0x3D +#define GET_CARD_ID_SEND_CONF 0x3E +#define SET_LED_CONFIG 0x6E +#define SET_UART_SPEED 0x70 +#define RED_LIGHT_CONTROL 0x71 +#define GET_DESFIRE_UID 0x80 + +// ERR codes +#define OK 0x00 +#define COMMUNICATION_ERROR 0x01 +#define COMMUNICATION_TIMEOUT 0x50 +#define COMMUNICATION_TIMEOUT_EXT 0x51 +#define CHKSUM_ERROR 0x02 +#define CHKSUM_ERROR_RESPONSE 0x52 +#define CHKSUM_ERROR_EXT 0x53 +#define READING_ERROR 0x03 +#define WRITING_ERROR 0x04 +#define BUFFER_OVERFLOW 0x05 +#define MAX_ADDRESS_EXCEEDED 0x06 +#define MAX_KEY_INDEX_EXCEEDED 0x07 +#define NO_CARD 0x08 +#define COMMAND_NOT_SUPPORTED 0x09 +#define FORBIDEN_DIRECT_WRITE_IN_SECTOR_TRAILER 0x0A +#define ADDRESSED_BLOCK_IS_NOT_SECTOR_TRAILER 0x0B +#define WRONG_ADDRESS_MODE 0x0C +#define WRONG_ACCESS_BITS_VALUES 0x0D +#define AUTH_ERROR 0x0E +#define PARAMETERS_ERROR 0x0F +#define WRITE_VERIFICATION_ERROR 0x70 +#define BUFFER_SIZE_EXCEEDED 0x71 +#define VALUE_BLOCK_INVALID 0x72 +#define VALUE_BLOCK_ADDR_INVALID 0x73 +#define VALUE_BLOCK_MANIPULATION_ERROR 0x74 + + + +// MIFARE CLASSIC type id's: +#define MIFARE_CLASSIC_1k 0x08 +#define MF1ICS50 0x08 +#define SLE66R35 0x88 // Infineon = Mifare Classic 1k +#define MIFARE_CLASSIC_4k 0x18 +#define MF1ICS70 0x18 +#define MIFARE_CLASSIC_MINI 0x09 +#define MF1ICS20 0x09 + +// DLOGIC CARD TYPE +#define TAG_UNKNOWN 0 +#define DL_MIFARE_ULTRALIGHT 0x01 +#define DL_MIFARE_ULTRALIGHT_EV1_11 0x02 +#define DL_MIFARE_ULTRALIGHT_EV1_21 0x03 +#define DL_MIFARE_ULTRALIGHT_C 0x04 +#define DL_NTAG_203 0x05 +#define DL_NTAG_210 0x06 +#define DL_NTAG_212 0x07 +#define DL_NTAG_213 0x08 +#define DL_NTAG_215 0x09 +#define DL_NTAG_216 0x0A +#define DL_MIKRON_MIK640D 0x0B +#define NFC_T2T_GENERIC 0x0C +#define DL_MIFARE_MINI 0x20 +#define DL_MIFARE_CLASSIC_1K 0x21 +#define DL_MIFARE_CLASSIC_4K 0x22 +#define DL_MIFARE_PLUS_S_2K 0x23 +#define DL_MIFARE_PLUS_S_4K 0x24 +#define DL_MIFARE_PLUS_X_2K 0x25 +#define DL_MIFARE_PLUS_X_4K 0x26 +#define DL_MIFARE_DESFIRE 0x27 +#define DL_MIFARE_DESFIRE_EV1_2K 0x28 +#define DL_MIFARE_DESFIRE_EV1_4K 0x29 +#define DL_MIFARE_DESFIRE_EV1_8K 0x2A +#define DL_MIFARE_DESFIRE_EV2_2K 0x2B +#define DL_MIFARE_DESFIRE_EV2_4K 0x2C +#define DL_MIFARE_DESFIRE_EV2_8K 0x2D +//#define DL_UNKNOWN_ISO_14443_4 0x40 +#define DL_GENERIC_ISO14443_4 0x40 +#define DL_GENERIC_ISO14443_TYPE_B 0x41 +#define DL_IMEI_UID 0x80 + +// Function return sizes in bytes +#define READER_TYPE_SIZE 4 +#define READER_SERIAL_SIZE 4 +#define READER_KEY_SIZE 6 +#define USER_DATA_SIZE 16 +#define CARD_ID_SIZE 4 +#define CARD_ID_EX_SIZE 10 + + +// USER_INTERFACE_SIGNAL + +#define NONE 0 +#define LONG_GREEN 1 +#define SHORT_BEEP 1 +#define LONG_RED 2 +#define LONG_BEEP 2 +#define ALTERNATNG_LIGHT 3 +#define DOUBLE_SHORT_BEEP 3 +#define FLASH_LIGHT 4 +#define TRIPLE_SHORT_BEEP 4 +#define TRIPLET_MELODY 5 + +enum PacketType { + PACKET_ACK = ACK_HEADER, + PACKET_ERR = ERR_HEADER, + PACKET_RSP = RESPONSE_HEADER +}; + +class uFR { + public: + #ifdef ESP32 + uFR(uint8_t uart); + uFR(uint8_t uart, uint8_t reset); + uFR(uint8_t uart, uint8_t rx_pin, uint8_t tx_pin); + uFR(uint8_t uart, uint8_t reset, uint8_t rx_pin, uint8_t tx_pin); + #else + uFR(uint8_t rx, uint8_t tx); + uFR(uint8_t rx, uint8_t tx, uint8_t reset); + #endif + + + void begin(unsigned long baud = 115200); // Resets the reader if reset pin is used; make sure to add delay! + inline void end() { readerSerial.end(); } + // Resets through reset pin (if declared) + void hardReset(); // Make sure to add delay! + + // All following functions return error codes after execution + // If 0 is returned, the function has executed normally + + // Controls the reader's red LED. Green LED stops flashing while red LED is on + uint8_t setRedLED(bool state); + + uint8_t setUserInterfaceSignal(uint8_t light_signal_mode = 0, uint8_t beep_signal_mode = 0); + + uint8_t setGreenLightBlinking(bool state); + + uint8_t getReaderType(uint8_t readerType[READER_TYPE_SIZE]); + + uint8_t getReaderSerial(uint8_t readerSerialNumber[READER_SERIAL_SIZE]); + + // Writes MIFARE key into reader EEPROM, at index location (0-31) + uint8_t setReaderKey(uint8_t key[READER_KEY_SIZE], uint8_t index); + + // User data are 16 bytes form internal EEPROM + uint8_t getUserData(uint8_t data[USER_DATA_SIZE]); + + uint8_t setUserData(uint8_t data[USER_DATA_SIZE]); + + // Sends reset command (add 2s delay!) + uint8_t softReset(); + + // Gets card UID that is present in reader's RF field. Obsolete + uint8_t getCardIDSimple(uint8_t cardID[CARD_ID_SIZE], uint8_t *cardType = nullptr); + + // Length - UID size in bytes (4, 7 or 10) + uint8_t getCardID(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length = nullptr, uint8_t *cardType = nullptr); + + // Gets Desfire UID + uint8_t getDesfireUID(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length = nullptr, uint8_t InternalAESKeyIndexReader = 0, uint32_t AID = 0, uint8_t key_number_in_application = 0); + + // Gets Desfire UID with provided AES key + uint8_t getDesfireUIDPK(uint8_t cardID[CARD_ID_EX_SIZE], uint8_t *length, uint8_t *AESKey = nullptr, uint32_t AID = 0, uint8_t key_number_in_application = 0); + + // Card type per DLogic enumeration + uint8_t getCardTypeDLogic(uint8_t *cardType); + + // ------------------------------------------------------------- + + static const char * TypeDLogicToString(uint8_t type); + + private: + #ifdef ESP32 + HardwareSerial readerSerial; + uint8_t esp32_rx_pin = 0; + uint8_t esp32_tx_pin = 0; + #else + SoftwareSerial readerSerial; + #endif + uint8_t resetPin = 0; + + void flushSerial(); // Flush serial input buffer + + void sendPacketCMD(uint8_t command, uint8_t EXTlength = 0, uint8_t par0 = 0, uint8_t par1 = 0); + void sendPacketEXT(uint8_t *packet, uint8_t length); + + void setPacketSerial (); // Sets static protected packet serial pointer + + class Packet { + public: + static uint8_t checksum(uint8_t *packet, uint8_t size = PACKET_LENGTH - 1); + inline uint8_t getErrorCode() { return errorCode; } + inline uint8_t getLength() { return length; } + void copyData(uint8_t *array, uint16_t start, uint16_t length); + void copyDataReverse(uint8_t *array, uint16_t start, uint16_t length); + inline uint8_t operator[] (uint8_t i) { return data[i]; } + friend void uFR::setPacketSerial (); + protected: + #ifdef ESP32 + static HardwareSerial *serial; + #else + static SoftwareSerial *serial; + #endif + uint8_t errorCode = 0; + uint8_t length = PACKET_LENGTH; + uint8_t *data; + }; + class CommonPacket : public Packet { + // Returns error code + uint8_t read(uint8_t response[PACKET_LENGTH]); + uint8_t validate(uint8_t packet[PACKET_LENGTH], PacketType type, uint8_t command); + public: + CommonPacket(PacketType type, uint8_t command); + ~CommonPacket(); + }; + class EXTPacket : public Packet { + // Returns error code, reads AND validates + uint8_t read(uint8_t *response, uint8_t length); + public: + EXTPacket(uint8_t length); + ~EXTPacket(); + }; +}; diff --git a/lib/esp32/CMakeLists.txt b/lib/esp32/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3ad626cd83c108f84095eb05152c1c8e2129ea46 --- /dev/null +++ b/lib/esp32/CMakeLists.txt @@ -0,0 +1,4 @@ +idf_component_register(INCLUDE_DIRS "include") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pragmas -Wno-unused-variable -Wno-maybe-uninitialized -Wno-implicit-function-declaration -mlongcalls -Wno-type-limits -Wno-implicit-fallthrough -Wno-format-overflow -Wno-comment -Wno-format-truncation -Wno-array-bounds -DDEBUG_PRINT=0 -D_NO_FTDI=1 -DESP_PLATFORM=1") +target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/lib") +target_link_libraries(${COMPONENT_LIB} INTERFACE ufcoder) \ No newline at end of file diff --git a/lib/esp32/component.mk b/lib/esp32/component.mk new file mode 100644 index 0000000000000000000000000000000000000000..7e1ff9fc7520d2287c5890de5d7121afa500dfd8 --- /dev/null +++ b/lib/esp32/component.mk @@ -0,0 +1,4 @@ +COMPONENT_ADD_INCLUDEDIRS := include +CFLAGS := -Wno-pragmas -Wno-unused-variable -Wno-maybe-uninitialized -Wno-implicit-function-declaration -mlongcalls -DDEBUG_PRINT=0 -D_NO_FTDI=1 + +COMPONENT_ADD_LDFLAGS += $(COMPONENT_PATH)/lib/libufcoder.a \ No newline at end of file diff --git a/lib/esp32/include/uFCoder.h b/lib/esp32/include/uFCoder.h new file mode 100644 index 0000000000000000000000000000000000000000..3ca540a810cf0ade52784eca94e4545f6b4ccd01 --- /dev/null +++ b/lib/esp32/include/uFCoder.h @@ -0,0 +1,48838 @@ +/* + * uFCoder.h + * + * library version: 6.0.2 + * + * Created on: 2009-01-14 + * Last edited: 2024-06-14 + * + * Author: D-Logic + */ +#ifndef uFCoder_H_ +#define uFCoder_H_ + +#include +#include +#include + +#define IN // array that you pass to function +#define OUT // array that you receive from function +#define VAR // first element of array that you receive from function (single variable) + +//////////////////////////////////////////////////////////////////// +/** + * Type for representing null terminated char array ( aka C-String ) + * Array is always one byte longer ( for null character ) then string + * Memory space for array must be allocated before use. + */ +typedef const char *c_string; +//////////////////////////////////////////////////////////////////// + +#ifdef _WIN32 +// WINDOWS +#if defined(DL_CREATE_STATIC_LIB) || defined(DL_USE_STATIC_LIB) +#define DL_API +#else +#ifndef DL_uFC_EXPORTS +#ifdef _WIN_IOT +#define DL_API __declspec(dllimport) // Win IoT +#else +#define DL_API /*__declspec(dllimport) */ __stdcall // STDCALL - GCC - .NET +#endif // _WIN_IOT +#else +#define DL_API __declspec(dllexport) __stdcall +#endif // DL_uFC_EXPORTS +#endif // DL_CREATE_STATIC_LIB +#else +// Linux & MAC OS +#define DL_API +#endif // _WIN32 + +#if defined(DL_uFC_EXPORTS) || defined(DL_CREATE_STATIC_LIB) || defined(__ANDROID__) || defined(ESP_PLATFORM) || defined(IOS_PLATFORM) +typedef struct S_UFR_HANDLE *UFR_HANDLE; +#else +typedef void *UFR_HANDLE; +#endif + +// MIFARE CLASSIC type id's: +#define MIFARE_CLASSIC_1k 0x08 +#define MF1ICS50 0x08 +#define SLE66R35 0x88 // Infineon = Mifare Classic 1k +#define MIFARE_CLASSIC_4k 0x18 +#define MF1ICS70 0x18 +#define MIFARE_CLASSIC_MINI 0x09 +#define MF1ICS20 0x09 + +// DLOGIC CARD TYPE +#define TAG_UNKNOWN 0 +#define DL_MIFARE_ULTRALIGHT 0x01 +#define DL_MIFARE_ULTRALIGHT_EV1_11 0x02 +#define DL_MIFARE_ULTRALIGHT_EV1_21 0x03 +#define DL_MIFARE_ULTRALIGHT_C 0x04 +#define DL_NTAG_203 0x05 +#define DL_NTAG_210 0x06 +#define DL_NTAG_212 0x07 +#define DL_NTAG_213 0x08 +#define DL_NTAG_215 0x09 +#define DL_NTAG_216 0x0A +#define DL_MIKRON_MIK640D 0x0B +#define NFC_T2T_GENERIC 0x0C +#define DL_NT3H_1101 0x0D +#define DL_NT3H_1201 0x0E +#define DL_NT3H_2111 0x0F +#define DL_NT3H_2211 0x10 +#define DL_NTAG_413_DNA 0x11 +#define DL_NTAG_424_DNA 0x12 +#define DL_NTAG_424_DNA_TT 0x13 +#define DL_NTAG_210U 0x14 +#define DL_NTAG_213_TT 0x15 + +#define DL_MIFARE_CLASSIC_2K 0x19 +#define DL_MIFARE_MINI 0x20 +#define DL_MIFARE_CLASSIC_1K 0x21 +#define DL_MIFARE_CLASSIC_4K 0x22 +#define DL_MIFARE_PLUS_S_2K_SL0 0x23 +#define DL_MIFARE_PLUS_S_4K_SL0 0x24 +#define DL_MIFARE_PLUS_X_2K_SL0 0x25 +#define DL_MIFARE_PLUS_X_4K_SL0 0x26 +#define DL_MIFARE_DESFIRE 0x27 +#define DL_MIFARE_DESFIRE_EV1_2K 0x28 +#define DL_MIFARE_DESFIRE_EV1_4K 0x29 +#define DL_MIFARE_DESFIRE_EV1_8K 0x2A +#define DL_MIFARE_DESFIRE_EV2_2K 0x2B +#define DL_MIFARE_DESFIRE_EV2_4K 0x2C +#define DL_MIFARE_DESFIRE_EV2_8K 0x2D +#define DL_MIFARE_PLUS_S_2K_SL1 0x2E +#define DL_MIFARE_PLUS_X_2K_SL1 0x2F +#define DL_MIFARE_PLUS_EV1_2K_SL1 0x30 +#define DL_MIFARE_PLUS_X_2K_SL2 0x31 +#define DL_MIFARE_PLUS_S_2K_SL3 0x32 +#define DL_MIFARE_PLUS_X_2K_SL3 0x33 +#define DL_MIFARE_PLUS_EV1_2K_SL3 0x34 +#define DL_MIFARE_PLUS_S_4K_SL1 0x35 +#define DL_MIFARE_PLUS_X_4K_SL1 0x36 +#define DL_MIFARE_PLUS_EV1_4K_SL1 0x37 +#define DL_MIFARE_PLUS_X_4K_SL2 0x38 +#define DL_MIFARE_PLUS_S_4K_SL3 0x39 +#define DL_MIFARE_PLUS_X_4K_SL3 0x3A +#define DL_MIFARE_PLUS_EV1_4K_SL3 0x3B +#define DL_MIFARE_PLUS_SE_SL0 0x3C +#define DL_MIFARE_PLUS_SE_SL1 0x3D +#define DL_MIFARE_PLUS_SE_SL3 0x3E +#define DL_MIFARE_DESFIRE_LIGHT 0x3F + +#define DL_UNKNOWN_ISO_14443_4 0x40 +#define DL_GENERIC_ISO14443_4 0x40 +#define DL_GENERIC_ISO14443_4_TYPE_B 0x41 +#define DL_GENERIC_ISO14443_3_TYPE_B 0x42 +#define DL_MIFARE_PLUS_EV1_2K_SL0 0x43 +#define DL_MIFARE_PLUS_EV1_4K_SL0 0x44 +#define DL_MIFARE_DESFIRE_EV3_2K 0x45 +#define DL_MIFARE_DESFIRE_EV3_4K 0x46 +#define DL_MIFARE_DESFIRE_EV3_8K 0x47 + +#define DL_MOBILE_AID 0x60 +#define DL_APPLE_VAS_V1 0x6A +#define DL_APPLE_VAS_V2 0x6B +#define DL_IMEI_UID 0x80 + +// ST Product ID-s: +#define M24SR02 0x82 +#define M24SR02_AUTOMOTIVE 0x8A +#define M24SR04 0x86 +#define M24SR04_AUTOMOTIVE 0x8E +#define M24SR16 0x85 +#define M24SR16_AUTOMOTIVE 0x8D +#define M24SR64 0x84 +#define M24SR64_AUTOMOTIVE 0x8C + +// DLJavaCardTypes: +#define DLSigner81 0xA0 +#define DLSigner22 0xA1 +#define DLSigner30 0xA2 +#define DLSigner10 0xA3 +#define DLSigner145 0xAA + +enum E_CARD_IN_SAM_SLOT +{ + SAM_SLOT_MIFARE_SAM_AV2 = 1, + SAM_SLOT_GENERIC = 4 +}; + +// DLJavaCardSignerAlgorithmTypes: +enum E_SIGNER_CIPHERS +{ + SIG_CIPHER_RSA = 0, + SIG_CIPHER_ECDSA, + + SIG_CIPHER_MAX_SUPPORTED +}; + +enum E_SIGNER_RSA_PADDINGS +{ + PAD_NULL = 0, + PAD_PKCS1_V1_5, + PAD_PKCS1_PSS, + + SIG_PAD_MAX_SUPPORTED +}; +#define PAD_PKCS1 PAD_PKCS1_V1_5 + +enum E_SIGNER_DIGESTS +{ + ALG_NULL = 0, + ALG_SHA, + ALG_SHA_256, + ALG_SHA_384, + ALG_SHA_512, + ALG_SHA_224, + ALG_SHA_512_224, + ALG_SHA_512_256, + + SIG_DIGEST_MAX_SUPPORTED +}; + +enum E_KEY_TYPES +{ + TYPE_RSA_PRIVATE = 0, + TYPE_RSA_CRT_PRIVATE, + TYPE_EC_F2M_PRIVATE, + TYPE_EC_FP_PRIVATE +}; + +enum E_OBJ_TYPES +{ + OBJ_TYPE_RSA_CERT = 0, + OBJ_TYPE_EC_CERT, + OBJ_TYPE_CA_CERT, + + OBJ_TYPES_COUNT +}; + +// JCDL_AIDs +#define DL_RAW_SIZEOF_SZ(x) (sizeof(x) - 1) +#define DL_AID_RID_PLUS "\xF0" "DLogic" +#define DL_SIGNER_PIX "\x00\x01" +#define DL_STORAGE_PIX "\x01\x01" +#define DL_SIGNER_AID DL_AID_RID_PLUS DL_SIGNER_PIX +#define DL_SIGNER_AID_SIZE 9 +#define DL_STORAGE_AID DL_AID_RID_PLUS DL_STORAGE_PIX +#define DL_STORAGE_AID_SIZE 9 + +// Universal JCDL instructions: +#define INS_LOGIN 0x20 +#define INS_GET_PIN_TRIES_REMAINING 0x21 +#define INS_PIN_CHANGE 0x22 +#define INS_PIN_UNBLOCK 0x23 + +// JCDLStorage instructions: +#define INS_PIN_ENABLE 0x24 +#define INS_PIN_DISABLE 0x25 +#define INS_LIST_FILES 0x31 +#define INS_GET_FILE_SIZE 0x32 +#define INS_READ_FILE 0x33 +#define INS_WRITE_FILE 0x34 +#define INS_DELETE_FILE 0x3F + +// JCDLSigner instructions: +#define INS_SET_RSA_PRIKEY 0x51 +#define INS_GEN_RSA_KEY_PAIR 0x52 +#define INS_GET_RSA_PUBKEY_MODULUS 0x53 +#define INS_GET_RSA_PUBKEY_EXPONENT 0x54 +#define INS_DEL_RSA_KEY_PAIR 0x5F +#define INS_SET_EC_PRIKEY 0x61 +#define INS_GEN_EC_KEY_PAIR 0x62 +#define INS_GET_EC_PUBKEY 0x63 +#define INS_GET_EC_FIELD 0x64 +#define INS_GET_EC_AB 0x65 +#define INS_GET_EC_G 0x66 +#define INS_GET_EC_RK_SIZE 0x67 +#define INS_DEL_EC_KEY_PAIR 0x6F +#define INS_GET_SIGNATURE 0x71 +#define INS_PUT_OBJ 0x31 +#define INS_PUT_OBJ_SUBJECT 0x32 +#define INS_INVALIDATE_CERT 0x33 +#define INS_GET_OBJ 0x41 +#define INS_GET_OBJ_ID 0x42 +#define INS_GET_OBJ_SUBJECT 0x43 + +// Universal JCDL constants: +#define PIN_MAX_TRIES 5 +#define PIN_MIN_LENGTH 4 +#define PIN_MAX_LENGTH 8 +#define PUK_MAX_TRIES 10 +#define PUK_LENGTH 8 + +// JCDLSigner constants: +#define JC_APP_MAX_KEY_INDEX ((3) - 1) +#define JC_APP_MAX_CA_CERT_INDEX ((12) - 1) +#define JC_APP_MAX_ID_SIZE 253 +#define JC_APP_MAX_SUBJECT_SIZE 255 +#define JC_APP_MAX_SIGNATURE_LEN 256 +#define JC_APP_MAX_PIN_LENGTH 8 + +// JCDLStorage constants: +#define JC_DL_STORAGE_MAX_FILES 16 +#define JC_DL_STORAGE_MAX_FILE_SIZE (32 * 1024 - 2) // 32KB - 2 byte system reserved + +// MIFARE CLASSIC Authentication Modes: +enum MIFARE_AUTHENTICATION +{ + MIFARE_AUTHENT1A = 0x60, + MIFARE_AUTHENT1B = 0x61, +}; + +// MIFARE PLUS AES Authentication Modes: +enum MIFARE_PLUS_AES_AUTHENTICATION +{ + MIFARE_PLUS_AES_AUTHENT1A = 0x80, + MIFARE_PLUS_AES_AUTHENT1B = 0x81, +}; + +enum MIFARE_PLUS_AES_KEY_TYPE +{ + MIFARE_PLUS_AES_KEY_A = 1, + MIFARE_PLUS_AES_KEY_B = 2, +}; + +// T2T authentication constants: +enum T2T_AUTHENTICATION +{ + T2T_NO_PWD_AUTH = 0, + T2T_RKA_PWD_AUTH = 1, + T2T_PK_PWD_AUTH = 3, + T2T_WITHOUT_PWD_AUTH = 0x60, + T2T_WITH_PWD_AUTH = 0x61, +}; + +// T4T authentication constants +enum T4T_AUTHENTICATION +{ + T4T_WITHOUT_PWD_AUTH = 0x60, + T4T_PK_PWD_AUTH = 0x80, + T4T_RKA_PWD_AUTH = 0x02, +}; + +enum ADDRESS_MODE +{ + ADDRESS_MODE_BLOCK = 0, + ADDRESS_MODE_SECTOR, +}; + +#define MAX_UID_LEN 10 +#define MAX_ATS_LEN 25 +#define ECC_SIG_LEN 32 + +// API Status Codes Type: +typedef enum UFCODER_ERROR_CODES +{ + UFR_OK = 0x00, + UFR_COMMUNICATION_ERROR = 0x01, + UFR_CHKSUM_ERROR = 0x02, + UFR_READING_ERROR = 0x03, + UFR_WRITING_ERROR = 0x04, + UFR_BUFFER_OVERFLOW = 0x05, + UFR_MAX_ADDRESS_EXCEEDED = 0x06, + UFR_MAX_KEY_INDEX_EXCEEDED = 0x07, + UFR_NO_CARD = 0x08, + UFR_COMMAND_NOT_SUPPORTED = 0x09, + UFR_FORBIDEN_DIRECT_WRITE_IN_SECTOR_TRAILER = 0x0A, + UFR_ADDRESSED_BLOCK_IS_NOT_SECTOR_TRAILER = 0x0B, + UFR_WRONG_ADDRESS_MODE = 0x0C, + UFR_WRONG_ACCESS_BITS_VALUES = 0x0D, + UFR_AUTH_ERROR = 0x0E, + UFR_PARAMETERS_ERROR = 0x0F, + UFR_MAX_SIZE_EXCEEDED = 0x10, + UFR_UNSUPPORTED_CARD_TYPE = 0x11, + + UFR_COMMUNICATION_BREAK = 0x50, + UFR_NO_MEMORY_ERROR = 0x51, + UFR_CAN_NOT_OPEN_READER = 0x52, + UFR_READER_NOT_SUPPORTED = 0x53, + UFR_READER_OPENING_ERROR = 0x54, + UFR_READER_PORT_NOT_OPENED = 0x55, + UFR_CANT_CLOSE_READER_PORT = 0x56, + + UFR_I2C_BUS_ERROR = 0x6A, + UFR_ECC_STORAGE_ERROR = 0x6B, + + UFR_WRITE_VERIFICATION_ERROR = 0x70, + UFR_BUFFER_SIZE_EXCEEDED = 0x71, + UFR_VALUE_BLOCK_INVALID = 0x72, + UFR_VALUE_BLOCK_ADDR_INVALID = 0x73, + UFR_VALUE_BLOCK_MANIPULATION_ERROR = 0x74, + UFR_WRONG_UI_MODE = 0x75, + UFR_KEYS_LOCKED = 0x76, + UFR_KEYS_UNLOCKED = 0x77, + UFR_WRONG_PASSWORD = 0x78, + UFR_CAN_NOT_LOCK_DEVICE = 0x79, + UFR_CAN_NOT_UNLOCK_DEVICE = 0x7A, + UFR_DEVICE_EEPROM_BUSY = 0x7B, + UFR_RTC_SET_ERROR = 0x7C, + + ANTI_COLLISION_DISABLED = 0x7D, + NO_TAGS_ENUMERRATED = 0x7E, + CARD_ALREADY_SELECTED = 0x7F, + + // NDEF error codes + UFR_WRONG_NDEF_CARD_FORMAT = 0x80, + UFR_NDEF_MESSAGE_NOT_FOUND = 0x81, + UFR_NDEF_UNSUPPORTED_CARD_TYPE = 0x82, + UFR_NDEF_CARD_FORMAT_ERROR = 0x83, + UFR_MAD_NOT_ENABLED = 0x84, + UFR_MAD_VERSION_NOT_SUPPORTED = 0x85, + UFR_NDEF_MESSAGE_NOT_COMPATIBLE = 0x86, + + // Tag emulation mode errors: + FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90, + + // FTDI errors: + UFR_FT_STATUS_ERROR_1 = 0xA0, + UFR_FT_STATUS_ERROR_2 = 0xA1, + UFR_FT_STATUS_ERROR_3 = 0xA2, + UFR_FT_STATUS_ERROR_4 = 0xA3, + UFR_FT_STATUS_ERROR_5 = 0xA4, + UFR_FT_STATUS_ERROR_6 = 0xA5, + UFR_FT_STATUS_ERROR_7 = 0xA6, + UFR_FT_STATUS_ERROR_8 = 0xA7, + UFR_FT_STATUS_ERROR_9 = 0xA8, + + // MIFARE PLUS error codes + UFR_MFP_COMMAND_OVERFLOW = 0xB0, + UFR_MFP_INVALID_MAC = 0xB1, + UFR_MFP_INVALID_BLOCK_NR = 0xB2, + UFR_MFP_NOT_EXIST_BLOCK_NR = 0xB3, + UFR_MFP_COND_OF_USE_ERROR = 0xB4, + UFR_MFP_LENGTH_ERROR = 0xB5, + UFR_MFP_GENERAL_MANIP_ERROR = 0xB6, + UFR_MFP_SWITCH_TO_ISO14443_4_ERROR = 0xB7, + UFR_MFP_ILLEGAL_STATUS_CODE = 0xB8, + UFR_MFP_MULTI_BLOCKS_READ = 0xB9, + + // NT4H error codes + NT4H_COMMAND_ABORTED = 0xC0, + NT4H_LENGTH_ERROR = 0xC1, + NT4H_PARAMETER_ERROR = 0xC2, + NT4H_NO_SUCH_KEY = 0xC3, + NT4H_PERMISSION_DENIED = 0xC4, + NT4H_AUTHENTICATION_DELAY = 0xC5, + NT4H_MEMORY_ERROR = 0xC6, + NT4H_INTEGRITY_ERROR = 0xC7, + NT4H_FILE_NOT_FOUND = 0xC8, + NT4H_BOUNDARY_ERROR = 0xC9, + NT4H_INVALID_MAC = 0xCA, + NT4H_NO_CHANGES = 0xCB, + + // multiple units - return from the functions with ReaderList_ prefix in name + UFR_DEVICE_WRONG_HANDLE = 0x100, + UFR_DEVICE_INDEX_OUT_OF_BOUND, + UFR_DEVICE_ALREADY_OPENED, + UFR_DEVICE_ALREADY_CLOSED, + UFR_DEVICE_IS_NOT_CONNECTED, + + // Originality Check Error Codes: + UFR_NOT_NXP_GENUINE = 0x200, + UFR_OPEN_SSL_DYNAMIC_LIB_FAILED, + UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND, + + // DESFIRE Card Status Error Codes: + READER_ERROR = 0xBB7, // 2999 [dec] + NO_CARD_DETECTED = 0xBB8, // 3000 [dec] + CARD_OPERATION_OK = 0xBB9, // 3001 [dec] + WRONG_KEY_TYPE = 0xBBA, // 3002 [dec] + KEY_AUTH_ERROR = 0xBBB, // 3003 [dec] + CARD_CRYPTO_ERROR = 0xBBC, // 3004 [dec] + READER_CARD_COMM_ERROR = 0xBBD, // 3005 [dec] + PC_READER_COMM_ERROR = 0xBBE, // 3006 [dec] + COMMIT_TRANSACTION_NO_REPLY = 0xBBF, // 3007 [dec] + COMMIT_TRANSACTION_ERROR = 0xBC0, // 3008 [dec] + NOT_SUPPORTED_KEY_TYPE = 0xBC2, // 3010 [dec] + WRONG_FILE_TYPE = 0xBC3, // 3011 [dec] + + DESFIRE_CARD_NO_CHANGES = 0x0C0C, + DESFIRE_CARD_OUT_OF_EEPROM_ERROR = 0x0C0E, + DESFIRE_CARD_ILLEGAL_COMMAND_CODE = 0x0C1C, + DESFIRE_CARD_INTEGRITY_ERROR = 0x0C1E, + DESFIRE_CARD_NO_SUCH_KEY = 0x0C40, + DESFIRE_CARD_LENGTH_ERROR = 0x0C7E, + DESFIRE_CARD_PERMISSION_DENIED = 0x0C9D, + DESFIRE_CARD_PARAMETER_ERROR = 0x0C9E, + DESFIRE_CARD_APPLICATION_NOT_FOUND = 0x0CA0, + DESFIRE_CARD_APPL_INTEGRITY_ERROR = 0x0CA1, + DESFIRE_CARD_AUTHENTICATION_ERROR = 0x0CAE, + DESFIRE_CARD_ADDITIONAL_FRAME = 0x0CAF, + DESFIRE_CARD_BOUNDARY_ERROR = 0x0CBE, + DESFIRE_CARD_PICC_INTEGRITY_ERROR = 0x0CC1, + DESFIRE_CARD_COMMAND_ABORTED = 0x0CCA, + DESFIRE_CARD_PICC_DISABLED_ERROR = 0x0CCD, + DESFIRE_CARD_COUNT_ERROR = 0x0CCE, + DESFIRE_CARD_DUPLICATE_ERROR = 0x0CDE, + DESFIRE_CARD_EEPROM_ERROR_DES = 0x0CEE, + DESFIRE_CARD_FILE_NOT_FOUND = 0x0CF0, + DESFIRE_CARD_FILE_INTEGRITY_ERROR = 0x0CF1, + DESFIRE_CATD_AUTHENTICATION_DELAY = 0X0CAD, + + // uFCoder library errors: + UFR_NOT_IMPLEMENTED = 0x1000, + UFR_COMMAND_FAILED = 0x1001, + UFR_TIMEOUT_ERR = 0x1002, + UFR_FILE_SYSTEM_ERROR = 0x1003, + UFR_FILE_SYSTEM_PATH_NOT_EXISTS = 0x1004, + UFR_FILE_NOT_EXISTS = 0x1005, + + // uFCoder library/licensing specific + UFR_JSON_INVALID = 0x1012, + UFR_LICENSE_INVALID = 0x1013, + UFR_LICENSE_SAVE_FAILED = 0x1014, + UFR_LICENSE_NOT_FOUND = 0x1015, + UFR_LICENSE_HAS_EXPIRED = 0x1016, + + // SAM module error codes: + UFR_SAM_APDU_ERROR = 0x2000, + UFR_SAM_AUTH_ERROR, + UFR_SAM_CRYPTO_ERROR, + + // TLS, HTTPS Error Codes: + TLS_ERR_OPENING_SOCKET = 0x5000, + TLS_ERR_NO_SUCH_HOST = 0x5001, + TLS_CONNECTING_ERROR = 0x5002, + TLS_ERR_SERVER_UNEXPECTEDLY_CLOSED_CONNECTION = 0x5003, + TLS_ERR_UNKNOWN_GIDS_CERTIFICATE_FORMAT = 0x5004, + TLS_ERR_SET_PIN_FOR_GIDS_CERT_ONLY = 0x5005, + TLS_ERR_GIDS_PIN_CODE_WRONG = 0x5006, + TLS_ERR_UNSUPPORTED_CERTIFICATE_TYPE = 0x5007, + TLS_ERR_PRIVATE_KEY_CONTEXT_WRONG = 0x5008, + + // JC cards APDU Error Codes: + UFR_APDU_TRANSCEIVE_ERROR = 0xAE, + UFR_APDU_JC_APP_NOT_SELECTED = 0x6000, + UFR_APDU_JC_APP_BUFF_EMPTY = 0x6001, + UFR_APDU_WRONG_SELECT_RESPONSE = 0x6002, + UFR_APDU_WRONG_KEY_TYPE = 0x6003, + UFR_APDU_WRONG_KEY_SIZE = 0x6004, + UFR_APDU_WRONG_KEY_PARAMS = 0x6005, + UFR_APDU_WRONG_SIGNING_ALGORITHM = 0x6006, + UFR_APDU_PLAIN_TEXT_MAX_SIZE_EXCEEDED = 0x6007, + UFR_APDU_UNSUPPORTED_KEY_SIZE = 0x6008, + UFR_APDU_UNSUPPORTED_ALGORITHMS = 0x6009, + UFR_APDU_PKI_OBJECT_NOT_FOUND = 0x600A, + UFR_APDU_MAX_PIN_LENGTH_EXCEEDED = 0x600B, + UFR_DIGEST_LENGTH_DOES_NOT_MATCH = 0x600C, + + // reserved: 0x6100, + CRYPTO_SUBSYS_NOT_INITIALIZED = 0x6101, + CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR = 0x6102, + CRYPTO_SUBSYS_MAX_HASH_INPUT_EXCEEDED = 0x6103, + CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM = 0x6104, + CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM = 0x6105, + CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM = 0x6106, + CRYPTO_SUBSYS_WRONG_SIGNATURE = 0x6107, + CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH = 0x6108, + CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE = 0x6109, + CRYPTO_SUBSYS_HASHING_ERROR = 0x610A, + CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS = 0x610B, + CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY = 0x610C, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS = 0x610D, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY = 0x610E, + + UFR_WRONG_PEM_CERT_FORMAT = 0x61C0, + + // X.509 specific statuses: + X509_CAN_NOT_OPEN_FILE = 0x6200, + X509_WRONG_DATA = 0x6201, + X509_WRONG_LENGTH = 0x6202, + X509_UNSUPPORTED_PUBLIC_KEY_TYPE = 0x6203, + X509_UNSUPPORTED_PUBLIC_KEY_SIZE = 0x6204, + X509_UNSUPPORTED_PUBLIC_KEY_EXPONENT = 0x6205, + X509_EXTENSION_NOT_FOUND = 0x6206, + X509_WRONG_SIGNATURE = 0x6207, + X509_UNKNOWN_PUBLIC_KEY_TYPE = 0x6208, + X509_WRONG_RSA_PUBLIC_KEY_FORMAT = 0x6209, + X509_WRONG_ECC_PUBLIC_KEY_FORMAT = 0x620A, + X509_SIGNATURE_NOT_MATCH_CA_PUBLIC_KEY = 0x620B, + X509_UNSUPPORTED_SIGNATURE_SCH = 0x620C, + X509_UNSUPPORTED_ECC_CURVE = 0x620D, + + // PKCS#7 specific statuses: + PKCS7_WRONG_DATA = 0x6241, + PKCS7_UNSUPPORTED_SIGNATURE_SCHEME = 0x6242, + PKCS7_SIG_SCH_NOT_MATCH_CERT_KEY_TYPE = 0x6243, + + PKCS7_WRONG_SIGNATURE = 0x6247, + + // MRTD specific statuses: + MRTD_SECURE_CHANNEL_SESSION_FAILED = 0x6280, + MRTD_WRONG_SOD_DATA = 0x6281, + MRTD_WRONG_SOD_LENGTH = 0x6282, + MRTD_UNKNOWN_DIGEST_ALGORITHM = 0x6283, + MRTD_WARNING_DOES_NOT_CONTAINS_DS_CERT = 0x6284, + MRTD_DATA_GROUOP_INDEX_NOT_EXIST = 0x6285, + MRTD_EF_COM_WRONG_DATA = 0x6286, + MRTD_EF_DG_WRONG_DATA = 0x6287, + MRTD_EF_DG1_WRONG_LDS_VERSION_LENGTH = 0x6288, + MRTD_VERIFY_CSCA_NOT_EXIST = 0x6289, + MRTD_VERIFY_WRONG_DS_SIGNATURE = 0x628A, + MRTD_VERIFY_WRONG_CSCA_SIGNATURE = 0x628B, + MRTD_MRZ_CHECK_ERROR = 0x628C, + + // ICAO Master List specific statuses: + ICAO_ML_WRONG_FORMAT = 0x6300, + ICAO_ML_CAN_NOT_OPEN_FILE = 0x6301, + ICAO_ML_CAN_NOT_READ_FILE = 0x6302, + ICAO_ML_CERTIFICATE_NOT_FOUND = 0x6303, + ICAO_ML_WRONG_SIGNATURE = 0x6307, + + // EMV specific statuses + SYS_ERR_OUT_OF_MEMORY = 0x7001, + EMV_ERR_WRONG_INPUT_DATA = 0x7002, + EMV_ERR_MAX_TAG_LEN_BYTES_EXCEEDED = 0x7004, + EMV_ERR_TAG_NOT_FOUND = 0x7005, + EMV_ERR_TAG_WRONG_SIZE = 0x7006, + EMV_ERR_TAG_WRONG_TYPE = 0x7007, + EMV_ERR_IN_CARD_READER = 0x7008, + EMV_ERR_READING_RECORD = 0x7009, + EMV_ERR_PDOL_IS_EMPTY = 0x7010, + EMV_ERR_LIST_FORMAT_NOT_FOUND = 0x7011, + EMV_ERR_AFL_NOT_FOUND = 0x7012, + EMV_ERR_AID_NOT_FOUND = 0x7013, + + // ISO7816-4 Errors (R-APDU) - 2 SW bytes returned by the card, prefixed with 0x000A: + UFR_APDU_SW_TAG = 0x000A0000, + UFR_APDU_SW_OPERATION_IS_FAILED = 0x000A6300, + UFR_APDU_SW_WRONG_PIN_4_TRIES_REMAINING = 0x000A63C4, + UFR_APDU_SW_WRONG_PIN_3_TRIES_REMAINING = 0x000A63C3, + UFR_APDU_SW_WRONG_PIN_2_TRIES_REMAINING = 0x000A63C2, + UFR_APDU_SW_WRONG_PIN_1_TRIES_REMAINING = 0x000A63C1, + UFR_APDU_SW_WRONG_PIN_0_TRIES_REMAINING = 0x000A63C0, + UFR_APDU_SW_WRONG_LENGTH = 0x000A6700, + UFR_APDU_SW_SECURITY_STATUS_NOT_SATISFIED = 0x000A6982, + UFR_APDU_SW_AUTHENTICATION_METHOD_BLOCKED = 0x000A6983, + UFR_APDU_SW_DATA_INVALID = 0x000A6984, + UFR_APDU_SW_CONDITIONS_NOT_SATISFIED = 0x000A6985, + UFR_APDU_SW_WRONG_DATA = 0x000A6A80, + UFR_APDU_SW_FILE_NOT_FOUND = 0x000A6A82, + UFR_APDU_SW_RECORD_NOT_FOUND = 0x000A6A83, + UFR_APDU_SW_DATA_NOT_FOUND = 0x000A6A88, + UFR_APDU_SW_ENTITY_ALREADY_EXISTS = 0x000A6A89, + UFR_APDU_SW_INS_NOT_SUPPORTED = 0x000A6D00, + UFR_APDU_SW_NO_PRECISE_DIAGNOSTIC = 0x000A6F00, + + MAX_UFR_STATUS = 0x7FFFFFFF + +} UFR_STATUS; + +// DESFIRE key settings values +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE 0x09 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE 0x0F +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x01 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x08 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x0E +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x00 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x06 + +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x00 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x01 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x02 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x03 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x04 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x05 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x06 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x08 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x09 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0A +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0B +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTH_AUTH 0x0C +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTH_AUTH 0x0D +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0E +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0F + +enum E_ASYMMETRIC_KEY_TYPES +{ + RSA_PRIVATE_KEY = 0, + ECDSA_PRIVATE_KEY, + + ASYMMETRIC_KEY_TYPES_NUM +}; + +#define MAX_ECC_CURVE_NAME_LEN 30 + +enum E_ECC_CURVE_DEFINITION_TYPES +{ + ECC_CURVE_INDEX, + ECC_CURVE_NAME, + ECC_CURVE_DOMAIN_PARAMETERS, + + ECC_CURVE_DEFINITION_TYPES_NUM +}; + +enum E_SIGNATURE_SCHEMES +{ + SHA1_WITH_RSA, + SHA256_WITH_RSA, + SHA384_WITH_RSA, + SHA512_WITH_RSA, + SHA224_WITH_RSA, + SHA512_224_WITH_RSA, + SHA512_256_WITH_RSA, + + RSA_PSS, + + ECDSA_WITH_SHA1, + ECDSA_WITH_SHA256, + ECDSA_WITH_SHA384, + ECDSA_WITH_SHA512, + ECDSA_WITH_SHA224, + + SIGNATURE_SCHEMES_NUM // Don't change the order. NEVER! +}; +enum E_SIGNATURE_SCH_TYPES +{ + RSA_PKCS1, + RSA_PKCS1_PSS, + ECDSA, + + SIGNATURE_SCH_TYPES_NUM +}; +enum E_PUB_KEY_TYPES +{ + PUB_KEY_TYPE_RSA, + PUB_KEY_TYPE_ECDSA_NAMED_CURVE, + PUB_KEY_TYPE_ECDSA_DOMAIN_PARAMS, + + PUB_KEY_TYPES_NUM +}; + +enum E_BIT_ENCODINGS +{ + ENCODING_BIN, + ENCODING_HEX +}; + +enum E_CERTIFICATE_TYPES +{ + X509_PEM, + X509_DER, + X509_GIDS_NFC, + + E_CERTIFICATE_TYPES_NUM +}; + +enum E_ECC_CURVES +{ + secp112r1, + secp112r2, + secp128r1, + secp128r2, + secp160r1, + secp160r2, + secp160k1, + secp192r1, + prime192v2, + prime192v3, + secp192k1, + secp224r1, + secp224k1, + secp256r1, + secp256k1, + secp384r1, + secp521r1, + prime239v1, + prime239v2, + prime239v3, + brainpoolP160r1, + brainpoolP192r1, + brainpoolP224r1, + brainpoolP256r1, + brainpoolP320r1, + brainpoolP384r1, + brainpoolP512r1, + brainpoolP160t1, + brainpoolP192t1, + brainpoolP224t1, + brainpoolP256t1, + brainpoolP320t1, + brainpoolP384t1, + brainpoolP512t1, + + ECC_CURVES_NUM + + /* Not supported in uFCoder library yet: + sect113r1, + sect113r2, + sect131r1, + sect131r2, + sect163k1, + sect163r1, + sect163r2, + sect193r1, + sect193r2, + sect233k1, + sect233r1, + sect239k1, + sect283k1, + sect283r1, + sect409k1, + sect409r1, + sect571k1, + sect571r1 + */ +}; +// #define F2M_CURVES sect113r1 + +typedef struct +{ + uint8_t *serial; + uint8_t *subject; + uint8_t *issuer; + uint8_t *SKI; + uint8_t *AKI; + uint32_t serial_len; + uint32_t subject_len; + uint32_t issuer_len; + uint32_t SKI_len; + uint32_t AKI_len; +} icaoMlSearchCriteria_t; + +typedef struct +{ + uint32_t ecc_curve_field_type; + void *field_domain_params; // To be defined. For now only a named primary field curves are supported. +} ecc_curve_domain_params_t; + +typedef struct +{ + uint32_t ecc_curve_definition_type; // one of the E_ECC_CURVE_DEFINITION_TYPES + uint32_t ecc_curve_index; + char *ecc_curve_name; + ecc_curve_domain_params_t *ecc_curve_domain_params; +} ecc_key_param_t; + +enum E_MRTD_IMG_TYPE +{ + MRTD_IMG_JPEG = 0, + MRTD_IMG_JP2 = 1, + MRTD_IMG_JPEG2000 = 1, // Alias for the MRTD_IMG_JP2 + + MRTD_IMG_TYPE_UNKNOWN = 0xFFFFFFFF +}; + +typedef enum +{ + USER_PIN = 0, + SO_PIN, + USER_PUK, + SO_PUK +} dl_sec_code_t; + +enum E_PRINT_VERBOSE_LEVELS +{ + PRINT_NONE, + PRINT_ESSENTIALS, + PRINT_DETAILS, + PRINT_ALL_PLUS_STATUSES, +}; + +// SAM definition +typedef enum E_SAM_HW_VER +{ + SAM_UNKNOWN_TYPE, + SAM_T1AD2060_AV1_MODE, + SAM_T1AD2060_AV2_MODE, + SAM_T1AR1070_AV1_MODE, + SAM_T1AR1070_AV2_MODE +} SAM_HW_TYPE; + +// Reader status +typedef enum E_EMULATION_MODES +{ + TAG_EMU_DISABLED, + TAG_EMU_DEDICATED, + TAG_EMU_COMBINED, + TAG_EMU_AUTO_AD_HOC +} emul_modes_t; + +typedef enum E_EMULATION_STATES +{ + EMULATION_NONE, + EMULATION_IDLE, + EMULATION_AUTO_COLL, + EMULATION_ACTIVE, + EMULATION_HALT, + EMULATION_POWER_OFF +} emul_states_t; + +typedef enum E_PCD_MGR_STATES +{ + PCD_MGR_NO_RF_GENERATED, + PCD_MGR_14443A_POLLING, + PCD_MGR_14443A_SELECTED, + PCD_MGR_CE_DEDICATED, + PCD_MGR_CE_COMBO_START, + PCD_MGR_CE_COMBO, + PCD_MGR_CE_COMBO_IN_FIELD +} pcd_states_t; + +enum E_RGB_PORT_NAMES +{ + EXTERNAL_RGB_PORT, + INTERNAL_RGB_PORT +}; + +enum E_CUSTOM_UI_IDLE_MODES +{ + CUSTOM_UI_IDLE_MODE_NONE = 0, + CUSTOM_UI_IDLE_MODE_STATIC_LED, + CUSTOM_UI_IDLE_MODE_BLINKING_LED, + CUSTOM_UI_IDLE_MODES_NUMBER_INDICATOR +}; + +enum E_CUSTOM_UI_DETECTED_MODES +{ + CUSTOM_UI_DETECTED_MODE_NONE = 0, + CUSTOM_UI_DETECTED_MODE_STATIC_LED, + CUSTOM_UI_DETECTED_MODE_STATIC_LED_BEEP, + CUSTOM_UI_DETECTED_MODE_BEEP, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED_BEEP, + CUSTOM_UI_DETECTED_MODES_NUMBER_INDICATOR +}; + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup INTERNAL !!!INTERNAL!!! uFR API calls (Not for public SDK use) (remove from final revision) + * @{ + */ + /** @} */ // end of defgroup INTERNAL + + /** + * @defgroup UNDOCUMENTED UNDOCUMENTED uFR API calls (remove from final revision) + * @brief Excluded from docs due to the nature of their usage + * @{ + */ + /**@}*/ // end of defgroup INTERNAL + + /** @defgroup LibLic Library licensing + * @brief Prerequisite API calls for facilitating use of uFR MDK (Mobile Development Kit) with Android/iOS devices (usage of mobile device internal NFC antenna) + * @{ + */ + /** @} */ // end of LibLic + + /** @defgroup SingleReader Single Reader + * @{ + */ + /** @defgroup ReaderAndLibrary Reader and library + ** @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication + + /** @defgroup ReaderAndLibrary_Information Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information + + /** @defgroup ReaderAndLibrary_EEPROM EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM + + /** @defgroup ReaderAndLibrary_Signalization Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization + + /** @defgroup ReaderAndLibrary_RGBSignalization RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL. + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFROnlineCommands uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands + + /** @defgroup ReaderAndLibrary_BaseHDUFR uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR + + /** @defgroup ReaderAndLibrary_NXPSAM Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM + + /** @defgroup ReaderAndLibrary_HelperFunc Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc + + /**@}*/ // end of defgroup ReaderAndLibrary + + /** @defgroup Card_Tag Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockRead(), BlockWrite(), LinearRead(), LinearWrite() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF + + /** @defgroup Card_Tag_NTAG_2XX NTAG2XX (Type 2) specific commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG + + /** @defgroup Card_Tag_NT4H NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H + + /** @defgroup Card_Tag_Mifare_Desfire Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire + + /** @defgroup Card_Tag_Mifare_Desfire_Light Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Desfire_Light + + /** @defgroup Card_Tag_Mifare_Plus Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Plus + + /** @defgroup Card_Tag_Ultralight_C Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Ultralight_C + + /** @defgroup Card_Tag_JavaCardApplication Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication + + /** @defgroup Card_Tag_CardFeatures Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4 ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4 + + /** @defgroup Card_Tag_CardFeatures_ISO7816 ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816 + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification + + /** @defgroup Card_Tag_CardFeatures_MRTD Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD + + /** @defgroup Card_Tag_CardFeatures_TLS TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS + + /** @defgroup Card_Tag_CardFeatures_EMV Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV + + /** @defgroup Card_Tag_CardFeatures_AntiCollision Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode + + /**@}*/ // end of defgroup Card_Tag_CardFeatures + + /**@}*/ // end of defgroup Card_Tag + + /** @defgroup Miscellaneous Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous + + /**@}*/ // end of defgroup SingleReader + + /** @defgroup MultiReader MultiReader + * @{ + ** @defgroup ReaderAndLibrary_ReaderList Handling multiple readers + * @brief If you want to communicate and use multiple readers from an application, you have to follow the + * initial procedure for enumerating uFR compatible devices and getting their handles + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_ReaderList + + /** @defgroup ReaderAndLibrary_M Reader and library + * @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + /** @defgroup ReaderAndLibrary_Communication_M Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication_M + + /** @defgroup ReaderAndLibrary_Information_M Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information_M + + /** @defgroup ReaderAndLibrary_EEPROM_M EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM_M + + /** @defgroup ReaderAndLibrary_Signalization_M Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization_M + + /** @defgroup ReaderAndLibrary_RGBSignalization_M RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_M Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFROnlineCommands_M uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands_M + + /** @defgroup ReaderAndLibrary_BaseHDUFR_M uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR_M + + /** @defgroup ReaderAndLibrary_NXPSAM_M Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM_M + + /** @defgroup ReaderAndLibrary_HelperFunc_M Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc_M + + /**@}*/ // end of defgroup ReaderAndLibrary_M + + /** @defgroup Card_Tag_M Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + /** @defgroup Card_Tag_General_M General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare_M Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockReadM(), BlockWriteM(), LinearReadM(), LinearWriteM() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF_M NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF_M + + /** @defgroup Card_Tag_NTAG_2XX_M NTAG2XX (Type 2) related commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG_2XX_M + + /** @defgroup Card_Tag_NT4H_M NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H_M + + /** @defgroup Card_Tag_Mifare_Desfire_M Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_M + + /** @defgroup Card_Tag_Mifare_Desfire_Light_M Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_Light_M + + /** @defgroup Card_Tag_Mifare_Plus_M Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Plus_M + + /** @defgroup Card_Tag_Ultralight_C_M Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + /**@}*/ + // end of defgroup Card_Tag_Ultralight_C_M + + /** @defgroup Card_Tag_JavaCardApplication_M Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + /** @defgroup Card_Tag_JavaCardApplication_Common_M Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common_M + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage_M DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage_M + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_M + + /** @defgroup Card_Tag_CardFeatures_M Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking_M Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking_M + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4_M ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4_M + + /** @defgroup Card_Tag_CardFeatures_ISO7816_M ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816_M + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M + + /** @defgroup Card_Tag_CardFeatures_MRTD_M Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD_M + + /** @defgroup Card_Tag_CardFeatures_TLS_M TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS_M + + /** @defgroup Card_Tag_CardFeatures_EMV_M Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV_M + + /** @defgroup Card_Tag_CardFeatures_AntiCollision_M Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision_M + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode_M Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode_M + + /**@}*/ // end of defgroup Card_Tag_CardFeatures_M + + /**@}*/ // end of defgroup Card_Tag_M + + /** @defgroup Miscellaneous_M Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous_M + + /**@}*/ // end of defgroup MultiReader + + /** @defgroup uFR_MDK uFR MDK (Mobile Development Kit) + * @since uFCoder library version 6.0.0 + * + * Using the internal NFC antenna of a mobile device is supported in the uFCoder library through the usage of ReaderOpenEx() with appropriate parameters. + * It is mandatory to obtain a valid DLogic license to make use of the uFR MDK. + * License can be obtained automatically through the ReaderOpenEx() API call. + * Or using the GetLicenseRequestData() and our online service found at: https://liblic.d-logic.com/
+ * Refer to @ref LibLic group for details. + * + * @{ + */ + /** @defgroup uFR_MDK_Android Android + * @brief uFR MDK for Android currently has support for the NTAG2XX, Mifare Classic®, Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * @{ + */ + /** @defgroup uFR_MDK_Android_NTAG2XX NTAG2XX with NDEF support + * @brief Supported API calls for NTAG2XX (e.g NTAG203/210/213/215/216) cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * read_ndef_record() + * * write_ndef_record() + * * write_ndef_record_mirroring() + * * write_ndef_record_mirroring_tt() + * * get_ndef_record_count() + * * erase_last_ndef_record() + * * erase_all_ndef_records() + * * ndef_card_initialization() + * * WriteNdefRecord_WiFi() + * * WriteNdefRecord_BT() + * * WriteNdefRecord_SMS() + * * WriteNdefRecord_Bitcoin() + * * WriteNdefRecord_GeoLocation() + * * WriteNdefRecord_NaviDestination() + * * WriteNdefRecord_Email() + * * WriteNdefRecord_Address() + * * WriteNdefRecord_AndroidApp() + * * WriteNdefRecord_Text() + * * WriteNdefRecord_StreetView() + * * WriteNdefRecord_Skype() + * * WriteNdefRecord_Whatsapp() + * * WriteNdefRecord_Viber() + * * WriteNdefRecord_Contact() + * * WriteNdefRecord_Phone() + * * ReadNdefRecord_WiFi() + * * ReadNdefRecord_Bitcoin() + * * ReadNdefRecord_GeoLocation() + * * ReadNdefRecord_NaviDestination() + * * ReadNdefRecord_Email() + * * ReadNdefRecord_Address() + * * ReadNdefRecord_AndroidApp() + * * ReadNdefRecord_Text() + * * ReadNdefRecord_StreetView() + * * ReadNdefRecord_Skype() + * * ReadNdefRecord_Whatsapp() + * * ReadNdefRecord_Viber() + * * ReadNdefRecord_Contact() + * * ReadNdefRecord_Phone() + * * ReadNdefRecord_SMS() + * * ReadNdefRecord_BT() + * * ParseNdefMessage() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_NTAG2XX + + /** @defgroup uFR_MDK_Android_Mifare Mifare Classic + * @brief Supported API calls for Mifare Classic cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * SectorTrailerWrite_PK() + * * SectorTrailerWriteUnsafe_PK() + * * ValueBlockRead_PK() + * * ValueBlockWrite_PK() + * * ValueBlockInSectorRead_PK() + * * ValueBlockInSectorWrite_PK() + * * ValueBlockIncrement_PK() + * * ValueBlockDecrement_PK() + * * ValueBlockInSectorIncrement_PK() + * * ValueBlockInSectorDecrement_PK() + * * LinearFormatCard_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Mifare + + /** @defgroup uFR_MDK_Android_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth() + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth() + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Desfire + + /** @defgroup uFR_MDK_Android_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_Android + + /** @defgroup uFR_MDK_iOS iOS + * @brief uFR MDK for IOS currently has support only for Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * + * @{ + */ + /** @defgroup uFR_MDK_iOS_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_iOS_Desfire + + + /** @defgroup uFR_MDK_IOS_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_IOS_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_iOS + + /**@}*/ // end of defgroup uFR_MDK + + //-------------------------------------------------------------------------------------------------- + /** + * @brief Used to generate license request necessary for obtaing valid uFCoder license separately. + * + * Parameter "license_request" will hold a JSON string value that is to be used for our online front-end service for generating an offline license. + * The online service is found at: https://liblic.d-logic.com/ + * + * @ingroup LibLic + * + * @param months: Number of months requested for the license + * @param license_request JSON string formed with licensing parameters + * + */ + void DL_API GetLicenseRequestData(uint32_t months, OUT char *license_request); + + /** + * @brief Used to validate and store an offline Dlogic license for future usage. + * + * @ingroup LibLic + * + * @param license_str: JSON string containing full license data + * + * @return Operation status + */ + UFR_STATUS DL_API SetLicenseData(c_string license_str); + + /** + * @brief Opens reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s, or if you have only one reader attached to another power supply (not your PC) it will open that reader based on it’s working mode (TCP or UDP). If you have more than one µFR Online device, ReaderOpen function will open the first one found, for opening another device, use ReaderOpenEx instead. + *
+ * NOTE: On Android, using ReaderOpen() will establish communication with uFR Series readers connected via OTG cable. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen(void); + + /** + * @brief Opens a port of connected reader using readers family type. Useful for speed up opening for non uFR basic reader type (e.g. BaseHD with uFR support). + * + * Do not use this function for opening communication with µFR Online devices. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenByType(uint32_t reader_type); + + enum E_READER_TYPE + { + AUTO = 0, + UFR_TYPE = 1, + UFR_RS232_TYPE = 2, + BASEHD_UFR_TYPE = 3, + UFR_ONLINE_TYPE = 4, + INTERNAL_NFC = 5 + }; + + /** + * @brief Open reader communication port in several different ways. Can be used for establishing communication with COM port too. + * + * There is enumeration in uFCoder.h file called E_READER_TYPE with values: + * enum E_READER_TYPE + * { + * AUTO = 0, + * UFR_TYPE = 1, + * UFR_RS232_TYPE = 2, + * BASEHD_UFR_TYPE = 3, + * UFR_ONLINE_TYPE = 4, + * INTERNAL_NFC = 5 + * }; + * Values in this enumeration you can pass into ReaderOpenEx function as reader_type parameter.
+ * For example, if you pass 4 as reader_type it will only work with µFR Online Series devices, and then as port_name you can pass devices IP address or serial number (ex: “192.168.1.123” or “ON101390”), for port_interface you can pass ‘U’ for UDP, ‘T’ for TCP or 0. + * If you pass 0, it will automatically search for reader working mode (UDP or TCP) and open it. For argument you can pass 0 or µFR Nano device serial number to open it on 1Mbit/s (ex: “UN123456”).
+ * Using value 5 as reader_type implies usage of internal mobile device NFC. + * Upon a call to ReaderOpenEx with this parameter, the library will try to obtain license automatically via HTTP. + * On success, a valid license is stored for future use. On failure, it moves to looking up for stored licenses. Results other than UFR_OK status imply a corresponding error that occurred and as such use of internal mobile device NFC will be unavailable. + * When using 5 as reader_type, additionally you can specify port_interface parameter to decide whether to do online->offline validation or just offline. To use offline-only validation of a previously stored valid DLogic license, set port_interface to 1. + * Value 0 is default value for port_interface and implies online->offline license validation. + * More examples for port open are given in the “Reader Open Examples” document: + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-doc/blob/master/Reader_Open_Examples.pdf + * Examples: + * ReaderOpenEx(1, “COM1”, 0, 0) + * This example will open communication with µFR device attached to COM1 port on 1Mbit/s + * ReaderOpenEx(1, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR device on 1Mbit/s + * ReaderOpenEx(2, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR RS232 device on 115200 bit/s + * ReaderOpenEx(4, “ON123456”, ‘U’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on UDP protocol. + * ReaderOpenEx(4, “ON123456”, ‘T’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘U’, 0) + * This example will open communication with µFR Online reader with IP address 192.168.1.123 on UDP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘T’, 0) + * This will open communication with µFR Online reader with IP address 192.168.1.123 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, 0, 0) + * It will open communication with µFR Online reader with IP address 192.168.1.123 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, 0) + * It will open communication with µFR Online reader with serial number ON123456 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with serial number ON123456 + * ReaderOpenEx(4, “192.168.1.123”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with IP address 192.168.1.123 + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) When uFR Online reader works in BT serial mode or transparent mode, reader_type must be set to 1. + * @param port_name is c-string type used to open port by given serial name. If you provide NULL or empty string that is AUTO MODE which calls ReaderOpenEx() and all available ports on the system. serial port name, identifier, like "COM3" on Windows or "/dev/ttyS0" on Linux or "/dev/tty.serial1" on OS X or if you select FTDI, reader serial number like "UN123456", if reader have integrated FTDI interface When the UDP interface type is selected, port_name must be provided in “address:port” format. Like "192.168.1.162:8881" IP for UDP I/F + * @param port_interface type of communication interfaces (define interface which we use while connecting to the printer), supported value's: 0 : auto - first try FTDI than serial if port_name is not defined 1 : try serial / virtual COM port / interfaces 2 : try only FTDI communication interfaces 10 : try to open Digital Logic Shields with RS232 uFReader on Raspberry Pi (serial interfaces with GPIO reset) 84 ('T') : TCP/IP interface 85 ('U') : UDP interface 102 ('B'): BT serial interface. Android library only. 114 ('L'): BLE interface. Android library only. When uFR Online reader works in BT serial mode, port_interface must be set to 0 (Except Android). arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * @param arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenEx(uint32_t reader_type, IN c_string port_name, uint32_t port_interface, IN void *arg); + + /** + * @brief Opens uFR Online device by serial number. + * + * Function will open communication (UDP or TCP) with device based on its working mode. If function cannot find given serial number, it will open communication on serial port with 1Mbit/s. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param serial_number Pointer to const char array (c_string) containing devices serial number (ex. “ON101390”). + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen_uFROnline(c_string serial_number); + + /** + * @brief Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderReset(void); + + /** + * @brief Physical reset of reader communication port & tests the communication before returning a UFR_STATUS code. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetWait(void); + + /** + * @brief Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderClose(void); + + /** + * @brief This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestart(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderHwReset(void); + + /** + * @brief Used to get the FTDI D2XX driver version number. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major: Byte value indicating driver version major number + * @param version_minor: Byte value indicating driver version minor number + * @param build: Byte value indicating driver version build number + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor, VAR uint8_t* build); + + /** + * @brief Used to get the FTDI D2XX driver version number as c-string. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_str: buffer that will contain driver version as c-string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersionStr(OUT char *version_str); + + /** + * @brief Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderType(IN uint32_t *lpulReaderType); + + /** + * @brief Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumber(IN uint32_t *lpulSerialNumber); + + /** + * @brief Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information + * + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnected(VAR uint32_t *connected); + + /** + * @brief Store a new key or change existing key under provided index parameter. + * + * The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWrite(IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLock(IN const uint8_t *password); + + /** + * @brief Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlock(IN const uint8_t *password); + + /** + * @brief This function turns sound and light reader signals. + * + * Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignal(uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). + * + * Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolume(uint8_t sound_volume); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserData(OUT uint8_t *aucData); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExt(OUT uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 byte array containing user data + * @return Operation status + */ + UFR_STATUS DL_API WriteUserData(IN const uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 byte array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExt(IN const uint8_t *aucData); + + /** + * @brief Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). + * + * We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @ingroup Card_Tag_General + * + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardId(VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * @ingroup Miscellaneous + * + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSak(VAR uint16_t *atqa, VAR uint8_t *sak); + + /** + * @brief Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKey(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKey(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKey(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKey(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKey(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesWritten, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * The method for proving authenticity is determined by the suffix in the functions names. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKey(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKey(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKey(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKey(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKey(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKey(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKey(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. + * + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Provided Key mode (PK) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PK(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PK(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PK(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PK(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PK(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PK(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PK(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PK(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PK(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PK(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PK(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTime(VAR uint8_t *time); + + /** + * @brief Function sets the date and time into the device's RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param password pointer to the 8 bytes array containing password time pointer to the 6 bytes array containing date and time representation + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTime(IN uint8_t *password, VAR uint8_t *time); + + /** + * @brief This function is used in Common, Advance and Access Control set of functions. + * + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM. Maximal length of array is 128 bytes. + * + * Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * @param password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeSector(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeBlock(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BusAdminCardMake(uint32_t serial, IN uint8_t *password); + + /** + * @brief Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information + * + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescription(OUT uint8_t pSerialDescription[8]); + + /** + * @brief Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information + * + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumber(VAR uint8_t *build); + + /** + * @brief This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs. + * + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi-card (anti collision) mode: + //------------------------------------------------------------------------------ + /** + * @brief This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollision(void); + + /** + * @brief Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollision(void); + + /** + * @brief If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. + * + * Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCards(VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + /** + * @brief For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. + * + * First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * Before calling this function you have to call EnumCards() first. + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCards(OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + /** + * @brief Selects one of the cards which UID is on the actual UID list of the enumerated cards. + * + * If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCard(IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. + * + * Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCard(void); + + /** + * @brief Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatus(VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + //------------------------------------------------------------------------------ + /** + * @brief This function returns card type according to DlogicCardType enumeration. + * + * For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General + * + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardType(VAR uint8_t *lpucCardType); + + /** + * @brief This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General + * + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturer(OUT char* card_manufacturer_str); + + /** + * @brief This function returns 8 bytes of the T2T version. + * + * All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersion(OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). + * + * The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General + * + * @param lpulLinearSize pointer to variable which contain size of user data space lpulRawSize pointer to variable which contain size of total data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSize(VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * @ingroup Miscellaneous + * + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatus(OUT uint8_t *tt_message, VAR uint8_t *tt_status); + //------------------------------------------------------------------------------ + /** + * @brief Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. + * + * The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @ingroup Card_Tag + * + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalData(OUT uint8_t data[32], VAR uint32_t *len); + + /** + * @brief Function returns reader’s serialized discovery loop structure. + * + * C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetup(OUT uint8_t *setupStruct, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoop(IN const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Function returns the AID set in the reader to retrieve the mobile phone's unique ID. + * + * If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAid(OUT uint8_t *aid, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAid(IN const uint8_t *aid, uint32_t len); + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfig(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtp(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlot(uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKey(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencrypted(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKey(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZone(uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZone(uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatus(VAR uint8_t *bool_config_zone_locked, VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevision(uint8_t revision[4]); + //------------------------------------------------------------------------------ + + // uFCoder PRO MODE + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProMode(VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProMode(const uint32_t ReaderProMode); + + // QR barcode crypt algorithm + // initialization. with TB serial like 'TB123456' + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_Initialize(IN const uint8_t *TBSerialString, uint16_t job_number); + + // You must define 25 bytes array in memory for out_card_data[] + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCard(const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + enum CARD_ENCRYPTION_CODE_TYPE + { + CODE_TYPE_STANDARD, + CODE_TYPE_GROUP, + CODE_TYPE_DAILY_RANGE, // valid from, but only to_timestamp / every day + }; + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNext(const uint32_t code_type, const uint32_t from_timestamp, const uint32_t to_timestamp, + const uint32_t additional_data_size, IN const uint8_t additional_data[], + VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSN(OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSN(VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSN(OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Function returns TNF, type of record, ID and payload from the NDEF record. + * + * NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_record(uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. + * + * Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, IN uint8_t *id, + IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, VAR uint8_t *card_formated); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_tt(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, + int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. + * + * Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_count(VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, OUT uint8_t *ndef_record_array, + VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_record(uint8_t message_nr); + + /** + * @brief Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_records(uint8_t message_nr); + + /** + * @brief Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. + * + * If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initialization(void); + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + /** + * @brief Function stores a message record for NTAG emulation mode into the reader. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdef(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief This function does the same as WriteEmulationNdef() function with the addition of an AAR embedded in to the NDEF message. + * + * AAR stands for “Android Application Record”. AAR is a special type of NDEF record that is used by Google’s Android operating system to signify to an NFC phone that an explicitly defined Android Application which should be used to handle an emulated NFC tag. Android App record will be added as the 2nd NDEF record in the NDEF message. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record type_record pointer to the array containing record type type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param type_record pointer to the array containing record type + * @param type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param id pointer to the array containing record ID + * @param id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param aar pointer to the array containing AAR record + * @param aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefWithAAR(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length, IN uint8_t *aar, uint8_t aar_length); + + /** + * @brief Put the reader permanently in a NDEF tag emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStart(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStop(void); + + /** + * @brief Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStart(void); + + /** + * @brief Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). + * + * uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStart(void); + + /** + * @brief Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStop(void); + + /** + * @brief This function returns current ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParams(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief This command set ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 CombinedModeEmulationStart Function description Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. Function declaration (C language) UFR_STATUS CombinedModeEmulationStart(void); Function takes no parameters. ________________ Support for ISO14443-4 protocol + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParams(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param is_field_present + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldState(VAR uint8_t *is_field_present); + + /** + * @brief Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommMode(void); + + /** + * @brief The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommMode(void); + + /** + * @brief Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRam(IN uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data + * @param addr + * @param data_len + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRam(OUT uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function stores a message record for NTAG emulation mode into the reader in the RAM. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRam(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, + IN uint8_t *id, uint8_t id_length, IN uint8_t *payload, uint32_t payload_length); + + /** + * @brief Put the reader permanently in a NDEF tag in RAM emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStopRam() function), or by reader reset. Use the function GetReaderStatus to check if the reader is still in emulation mode (maybe the reader was reset for some reason). + * From library version 5.0.31, and firmware version 5.0.31 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartRam(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopRam(void); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value sets to 0. + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value stays unchangeable. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterNonResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function disables the NFC counter in the card emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterDisabled(void); + + //------------------------------------------------------------------------------ + + // GetNfcT2TVersion() returns 8 bytes (see T2T documentation): + typedef struct t2t_version_struct + { + uint8_t header; + uint8_t vendor_id; + uint8_t product_type; + uint8_t product_subtype; + uint8_t major_product_version; + uint8_t minor_product_version; + uint8_t storage_size; + uint8_t protocol_type; + } t2t_version_t; + + // NfcT2TSafeConvertVersion() returns converts version_record that returned from GetNfcT2TVersion() + // or GetNfcT2TVersionM(). Conversion is "alignment safe" + // (you don't need to pay attention on structure byte alignment): + /** + * @brief This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion(). + * + * All modern T2T chips having same or very similar structure of the T2T version data represented in the uFR API by the structure type t2t_version_t: + * typedef struct t2t_version_struct { + * uint8_t header; + * uint8_t vendor_id; + * uint8_t product_type; + * uint8_t product_subtype; + * uint8_t major_product_version; + * uint8_t minor_product_version; + * uint8_t storage_size; + * uint8_t protocol_type; + * } t2t_version_t; + * This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). Conversion done by this function is "alignment safe". + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param version pointer to the structure of the t2t_version_t type which will receive converted T2T version + * @param version_record pointer to array containing 8 bytes of the raw T2T version acquired using function GetNfcT2TVersion() + * + * @return Operation status + */ + void DL_API NfcT2TSafeConvertVersion(t2t_version_t *version, const uint8_t *version_record); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignature(OUT uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], VAR uint8_t *lpucUidLen, + VAR uint8_t *lpucDlogicCardType); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExt(OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + /** + * @brief This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounter(uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounter(uint8_t counter_address, uint32_t inc_value); + + /** + * @brief This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. + * + * If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounter(VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK(VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK(VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfig(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigEx(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfig(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigEx(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only. Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode idle mode value + * @param card_detection_mode card detection mode value + * @param idle_color idle color value(RGB) + * @param card_detection_color card detection color value(RGB) + * @param enabled enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfig(uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only. Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode pointer to idle mode value + * @param card_detection_mode pointer to card detection mode value + * @param idle_color pointer to idle color value(RGB) + * @param card_detection_color pointer to card detection color value(RGB) + * @param enabled pointer to enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfig(uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_number(VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, uint8_t start_hour, + uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record(uint8_t record_number, VAR uint16_t *first_reader_nr, VAR uint16_t *last_reader_nr, + VAR uint8_t *start_hour, VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_record(uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_record(uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, uint8_t begin_hour, + uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, uint8_t end_hour, + uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_record(VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, VAR uint8_t *end_month, + VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_type(uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_type(VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_duration(uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_duration(VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_duration(uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_duration(VAR uint32_t *duration); + + // swimming pool ************************************************************** + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validity(VAR int32_t *credit, VAR uint32_t *begin_year, VAR uint32_t *begin_month, + VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, // + VAR uint32_t *end_year, VAR uint32_t *end_month, VAR uint32_t *end_day, + VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validity(int32_t credit, uint32_t begin_year, uint32_t begin_month, uint32_t begin_day, + uint32_t begin_hour, + uint32_t begin_minute, // + uint32_t end_year, uint32_t end_month, uint32_t end_day, uint32_t end_hour, + uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_record(uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_record(uint8_t record_number, VAR uint8_t *right_record_type, OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counter(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, + uint8_t end_minute, IN uint8_t *days, uint8_t max_daily_counter); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record_type_max_daily_counter(uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, + VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days, VAR uint8_t *max_daily_counter); + + //============================================================================= + + /** + * @brief Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOn(uint16_t pulse_duration); + + /** + * @brief Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayState(uint8_t state); + + /** + * @brief Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param intercom shows that there is voltage at the terminals for intercom connection, or notss + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoState(VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControl(uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Function gets the state of the input pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param input_nr ordinal number of hardware specific input pin input_state input state 1 or 0. + * @param input_state input state 1 or 0. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetInputState(uint8_t input_nr, VAR uint8_t *input_state); + + /** + * @brief This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControl(uint8_t light_status); + + /** + * @brief For classic uFR PLUS devices only. The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. + * + * This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControl(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Sets the color of the RGB diodes. + * + * This color stays on the RGB diodes until the function GreenLedBlinkingTurnOn() is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity(). + * Before this function call, the function GreenLedBlinkingTurnOff() must be called, or the reader is already in mode of blocking automatic signalization. + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControl(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControl(uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes. + * + * This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleep(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. + * + * In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. + * Function also sets the number of omitted activity periods, when the RGB light is off. + * For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriod(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSet(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefault(void); + + /** + * @brief The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. + * + * Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMax(uint8_t bad_select_nr_max); + + /** + * @brief The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMax(VAR uint8_t *bad_select_nr_max); + + /** + * @brief Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepMode(void); + + /** + * @brief Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepMode(void); + + /** + * @brief Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSet(uint8_t seconds_wait); + + /** + * @brief Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGet(VAR uint8_t *seconds_wait); + + /** + * @brief This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanently(unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParameters(VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. + * + * Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. + * The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. + * For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayData(IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Function has the same functionality as the function SetDisplayData(). New feature is the RGB port selection. + * + * Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbData(IN uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequency(uint16_t frequency); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * SetRgbIntensity()(alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * GetRgbIntensity (alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensity(VAR uint8_t *intensity); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRgbIntensity(VAR uint8_t *intensity); + // DESFIRE functions ************************************************************** + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode(void); + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATS(OUT uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorage(void); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceive(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint32_t *ufr_status); + + /** + * @brief Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Transceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, uint8_t data_out_len, + OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, uint8_t send_le, + OUT uint8_t *apdu_status); + + /** + * @brief Sends C–APDU in the c_string (zero terminated) format, containing pairs of the hexadecimal digits. + * + * Pairs of the hexadecimal digits can be delimited by any of the punctuation characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu C-APDU hexadecimal c_string + * @param *r_apdu Received R-APDU as a hexadecimal c_string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceive(IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are sent and receive in the form of the byte arrays. + * + * There is obvious need for a c_apdu_len and *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceive(IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @param c_apdu + * @param c_apdu_len + * @param *r_apdu + * @param r_apdu_len + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeap(IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief This is “exploded binary” alternative function intended for support APDU commands in ISO 14443-4A tags. + * APDUTransceive() receives separated parameters which are an integral part of the C– APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls + * @param ins + * @param p1 + * @param p2 + * @param data_out + * @param Nc + * @param data_in + * @param Ne + * @param send_le + * @param apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, uint32_t Nc, + OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chain(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint8_t *rcv_chained, + VAR uint32_t *ufr_status); + + /** + * @brief R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceive(uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselect(uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * @ingroup UNDOCUMENTED + * + * @param card_activate + * @param card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 + * @param timeout + * @param tx_data + * @param tx_data_len + * @param rx_data + * @param rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive(uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, uint8_t crypto1, + uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Function sets the parameters for transceive mode. + * + * If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_start(uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stop(void); + + /** + * @brief Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enable(void); + + /** + * @brief The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending rcv_data pointer to data array received from card bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceive(IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, uint32_t bytes_to_receive, + VAR uint32_t *rcv_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interface(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_Generic(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interface(void); + + /** + * @brief Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDU(void); + + /** + * @brief Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4(void); + + /** + * @brief Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interface(void); + + /** + * @brief APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interface(void); + + //============================================================================== + /** + * @brief Using this function you can select the appropriate application on the card. + * + * For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAid(IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief In JCApp cards you can put two types of asymmetric crypto keys. + * + * Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKey(uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + const IN uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPair(uint8_t key_type, uint8_t key_index, uint8_t key_designator, uint16_t key_bit_len, + IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPair(uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPair(uint8_t key_index); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBegin(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *chunk, + uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdate(IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEnd(VAR uint16_t *sig_len); + + /** + * @brief This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignature(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *plain_data, + uint16_t plain_data_len, VAR uint16_t *sig_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Finally, to get a signature, you have to call JCAppGetSignature(). + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior calling of this function you have to be logged in with an User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig Pointer to an array of “sig_len” bytes length. Value of the “sig_len” you've got as a parameter of the JCAppSignatureEnd() or JCAppGenerateSignature() functions. You have to allocate those bytes before calling this function. + * @param sig_len Length of the allocated bytes in a sig array. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetSignature(OUT uint8_t *sig, uint16_t sig_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObj(uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, uint8_t id_size); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubject(uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Using this function you can delete certificate objects from a card. + * + * This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCert(uint8_t obj_type, uint8_t obj_index); + + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjId(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubject(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObj(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + /** + * + * @ingroup Card_Tag_JavaCardApplication + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + c_string DL_API JCAppGetErrorDescription(UFR_STATUS apdu_error_status); + + /** + * @brief This function is used to login to the JCApp with an appropriate PIN code. + * + * Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. JCAppGetPinTriesRemaining Function description This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. This function have parameter of the type dl_sec_code_t which is defined as: typedef enum { USER_PIN = 0, SO_PIN, USER_PUK, SO_PUK } dl_sec_code_t; + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLogin(uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemaining(dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t. + * + * Which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code. + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChange(dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief This function is used to unblock PIN code which is specified by the SO parameter. + * + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblock(uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index + * @param modulus + * @param modulus_size + * @param exponent + * @param exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKey(uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, OUT uint8_t *exponent, + VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index + * @param keyW + * @param keyWSize + * @param field + * @param field_size + * @param ab + * @param ab_size + * @param g + * @param g_size + * @param r + * @param r_size + * @param k + * @param key_size_bits + * @param key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKey( + uint8_t key_index, OUT uint8_t *keyW, + VAR uint16_t *keyWSize, // when keyW == NULL, returns size + OUT uint8_t *field, VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, VAR uint16_t *g_size, + OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index + * @param key_size_bits + * @param key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBits(uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + //------------------------------------------------------------------------------ + /** + * @brief This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. + * + * Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list_size ointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSize(VAR uint32_t *list_size); + + /** + * @brief After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFiles(OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief This function returns file size indexed by the parameter card_file_index, on successful execution. + * + * Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file which size we want to get. + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSize(uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFile(uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief This function reads a file from the DLStorage card directly to the new file on the host file-system. + * + * If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. + * + * Parameter data_size defines the amount of data to be written in the file on the DLStorage card. + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFile(uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief This function writes file content from the host file-system to the new file on the DLStorage card. + * + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief After successful call to this function, the file on the DLStorage card will be deleted. + * + * Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFile(uint8_t file_index); + //------------------------------------------------------------------------------ + /** + * @brief This function is used to get hash output length in bytes for specified hash algorithms. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator for which we want to get output length in bytes. Use values declared in E_HASH_ALGS enumeration. + * @param out_byte_len After successful function execution, the variable on which this pointer points to, will contain output hash length in bytes for specified hash algorithm. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashOutputByteLength(uint32_t hash_algo, VAR uint32_t *out_byte_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions) + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHash(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, OUT uint8_t *hash, uint32_t hash_alocated); + + /** + * @brief This function calculates and returns the hash of the data in the buffer pointed by the “in” function parameter. + * + * Hash algorithm is specified by the hash_algo function parameter. + * If output bytes don't match with hash_alocated function parameter function returns CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH status. + * GetHashToHeap() automatically allocates memory, which *hash parameter will point to after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used for calculation. Use values declared in E_HASH_ALGS enumeration. + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions). + * @param hash After successful function execution, the variable on which this pointer points to, will contain the pointer to the output hash. + * @param hash_len After successful function execution, the variable on which this pointer points to, will contain output hash length. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashToHeap(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, VAR uint8_t **hash, VAR uint32_t *hash_len); + + /** + * @brief This function is used in conjunction with DLHashUpdateChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() has to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used in the following hashing sequence. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashInitChunked(uint32_t hash_algo); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param in One of the chunks of data of which hash is calculated. + * @param in_len Chunk length in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashUpdateChunked(IN const uint8_t *in, uint32_t in_len); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunked(OUT uint8_t *hash, uint32_t hash_alocated); + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * DLHashFinishChunkedToHeap() automatically allocates memory, which *hash parameter will point to, after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunkedToHeap(OUT uint8_t **hash, VAR uint32_t *hash_alocated); + + /** + * @brief This function is used to verify the digital signature of the pre-hashed value or some relatively short plain text message. + * + * If there is no errors during the verification process and digital signature correspond to the "To Be Signed" (TBS) data array and public cryptographic key, the function returns UFR_OK status. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * In case of wrong digital signature, function returns CRYPTO_SUBSYS_WRONG_SIGNATURE status. + * Function can return following status codes in case of various errors: + * * CRYPTO_SUBSYS_NOT_INITIALIZED + * * CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS + * * CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS + * * CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE + * * CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR + * For digest_alg use one of the values declared in E_SIGNER_DIGESTS enumeration: + * enum E_SIGNER_DIGESTS { + * ALG_NULL = 0, + * ALG_SHA, + * ALG_SHA_256, + * ALG_SHA_384, + * ALG_SHA_512, + * ALG_SHA_224, + * ALG_SHA_512_224, + * ALG_SHA_512_256, + * SIG_DIGEST_MAX_SUPPORTED + * }; + * ALG_SHA is the designator for the SHA-1 algorithm. + * For padding_alg use one of the values declared in E_SIGNER_RSA_PADDINGS enumeration: + * enum E_SIGNER_RSA_PADDINGS { + * PAD_NULL = 0, + * PAD_PKCS1_V1_5, + * PAD_PKCS1_PSS, + * SIG_PAD_MAX_SUPPORTED + * }; + * PAD_PKCS1 is an alias of the PAD_PKCS1_V1_5 padding algorithm: + * #define PAD_PKCS1 PAD_PKCS1_V1_5 + * For cipher_alg use one of the values declared in E_SIGNER_CIPHERS enumeration: + * enum E_SIGNER_CIPHERS { + * SIG_CIPHER_RSA = 0, + * SIG_CIPHER_ECDSA, + * SIG_CIPHER_MAX_SUPPORTED + * }; + * When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * + * @ingroup Card_Tag_CardFeatures_DigitalSignatureVerification + * + * @param digest_alg in the E_SIGNER_DIGESTS enumeration. + * @param padding_alg in the E_SIGNER_RSA_PADDINGS enumeration. When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * @param cypher_alg in the E_SIGNER_CIPHERS enumeration. tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * @param tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param signature Pointer to the signature array. + * @param signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. + * @param sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). + * @param pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. + * @param pub_key_params_len Length of the additional public key parameters (in bytes). + * + * @return Operation status + */ + UFR_STATUS DL_API DigitalSignatureVerifyHash(uint32_t digest_alg, uint32_t padding_alg, uint32_t cypher_alg, IN const uint8_t *tbs, + uint32_t tbs_len, IN const uint8_t *signature, uint32_t signature_len, + IN const void *sig_params, uint32_t sig_params_len, IN const uint8_t *pub_key, + uint32_t pub_key_len, IN const void *pub_key_params, uint32_t pub_key_params_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetHashName(uint32_t hash_algo); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the ECC curve designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param eccCurve ECC curve designator. Use values declared in E_ECC_CURVES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetEccCurveName(uint32_t eccCurve); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the signature scheme (signature algorithm) designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param signatureScheme Signature scheme (signature algorithm) designator. Use values declared in E_SIGNATURE_SCHEMES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetSignatureSchemeName(uint32_t signatureScheme); + + /** + * @brief Release the memory allocated from some of the library functions previously called making it available again for further allocations. + * + * Use to deallocate i.e. cleanup memory on the heap allocated. This function is a so-called helper for programming languages other than C/C++ where you can use a free(ptr) instead. Use only after calling the library functions for which it is explicitly indicated in this manual. Function returns nothing. After successful function execution ptr will point to NULL. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param ptr Pointer to the memory allocated on the heap which you want to release. If ptr does not point to a block of memory allocated with the library functions, it causes undefined behavior. If ptr is NULL, the function does nothing. Digital signature verification Enumerations, types and structures for use with DigitalSignatureVerifyHash function enum E_ECC_CURVE_DEFINITION_TYPES { ECC_CURVE_INDEX, ECC_CURVE_NAME, ECC_CURVE_DOMAIN_PARAMETERS, ECC_CURVE_DEFINITION_TYPES_NUM }; + * + * @return Operation status + */ + void DL_API DLFree(void *ptr); + //------------------------------------------------------------------------------ + /** + * @brief Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBac(IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], + VAR uint64_t *send_sequence_cnt); + + /** + * @brief Use this function to read files from the eMRTD NFC tag. + * + * You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param file_index Parameter that specifies the file we want to read from the eMRTD. This is a pointer to byte array containing exactly two bytes designating eMRTD file. Those two bytes are file identificator (FID) and there is a list of FIDs: EF.COM = {0x01, 0x1E} EF.DG1 = {0x01, 0x01} EF.DG2 = {0x01, 0x02} EF.DG3 = {0x01, 0x03} EF.DG4 = {0x01, 0x04} EF.DG5 = {0x01, 0x05} EF.DG6 = {0x01, 0x06} EF.DG7 = {0x01, 0x07} EF.DG8 = {0x01, 0x08} EF.DG9 = {0x01, 0x09} EF.DG10 = {0x01, 0x0A} EF.DG11 = {0x01, 0x0B} EF.DG12 = {0x01, 0x0C} EF.DG13 = {0x01, 0x0D} EF.DG14 = {0x01, 0x0E} EF.DG15 = {0x01, 0x0F} EF.DG16 = {0x01, 0x10} EF.SOD = {0x01, 0x1D} + * @param output After the successful call to this function, this pointer will point to the pointer on the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated during function execution. Maximum amount of data allocated can be 32KB. There is a programmer responsibility to cleanup allocated data (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * @param output_length After the successful call to this function, this pointer is pointed to the size of the file data read from an eMRTD file specified by the file_index parameter. + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeap(IN const uint8_t file_index[2], VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief This function validates data groups read from the eMRTDocument. + * + * All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function.\ + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidate(IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, uint32_t verbose_level, + OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, you can call this function and pass it null terminated strings containing document number, document holder date of birth and document expiration date. + * + * After successful function execution MRZ Proto Key will be stored in a mrz_proto_key 25-byte array. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param doc_number Pointer to a null terminated string containing exactly 9 characters document number. + * @param date_of_birth Pointer to a null terminated string containing exactly 6 characters representing the date of birth in the “YYMMDD” format. + * @param date_of_expiry Pointer to a null terminated string containing exactly 6 characters representing expiration date in the “YYMMDD” format. + * @param mrz_proto_key This byte array will contain a calculated MRZ proto-key after successful function execution. This array must have allocated at least 25 bytes prior to calling this function. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTD_MRZDataToMRZProtoKey(IN const char *doc_number, IN const char *date_of_birth, IN const char *date_of_expiry, + OUT uint8_t mrz_proto_key[25]); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, in the case of the TD3 MRZ format (88 totally character long), you can call this function and pass it a null terminated string containing the MRZ subjacent row. + * + * Example of the TD3 MRZ format printed on the eMRTD document looks like this: + * P 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnectedM(UFR_HANDLE hndUFR, VAR uint32_t *connected); + + /** + * @brief Multi reader support. Store a new key or change existing key under provided index parameter.The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Multi reader support. Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. This function turns sound and light reader signals. Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignalM(UFR_HANDLE hndUFR, uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Multi reader support. From version 5.0.68. + * Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolumeM(UFR_HANDLE hndUFR, uint8_t sound_volume); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExtM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExtM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @param hndUFR handle of the uFR device + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * Multi reader support. From library version 5.0.36 and firmware version 5.0.37 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSakM(UFR_HANDLE hndUFR, uint16_t *atqa, uint8_t *sak); + + /** + * @brief Multi reader support. Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authenticationwith key A or key B:use KeyA - MIFARE_AUTHENT1A = 0x60or KeyB - MIFARE_AUTHENT1B = 0x61For NTAG 21x, Ultralight EV1 and other T2T tags supportingPWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead()or LinearRead_PK() functions. Value 0x60 with LinearRead() orLinearRead_PK() functions means “without PWD_AUTH“ and in thatcase you can send for ucReaderKeyIndex or aucProvidedKeyparameters anything you want without influence on the result. ForNTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTHyou can use _AKM1 or _AKM2 function variants only withoutPWD_AUTH in any case of the valid values (0x60 or 0x61) providedfor this parameter.For Mifare Plus tags (PK mode) defines whether to performauthentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCardM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKeyM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafeM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode)For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters + + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using absolute Block address. + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PKM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * Multi reader support. + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Multi reader support. Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + // New commands (for RTC & I2C EEPROM): + /** + * @brief Multi reader support. Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTimeM(UFR_HANDLE hndUFR, VAR uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into the device's RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password time + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTimeM(UFR_HANDLE hndUFR, IN uint8_t *password, VAR uint8_t *time); + + /** + * @brief Multi reader support. This function is used in Common, Advance and Access Control set of functions. + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPasswordM(UFR_HANDLE hndUFR, IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM. Maximal length of array is 128 bytes. Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWriteM(UFR_HANDLE hndUFR, IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param pSerialDescription[8] pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescriptionM(UFR_HANDLE hndUFR, OUT uint8_t pSerialDescription[8]); + + // New since version 2.0: + /** + * @brief Multi reader support. Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumberM(UFR_HANDLE hndUFR, VAR uint8_t *build); + + /** + * @brief Multi reader support. This function returns UID of card actually present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief Multi reader support. This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi card mode: + //------------------------------------------------------------------------------ + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCardsM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + + /** + * @brief Multi reader support. Before calling this function you have to call EnumCards() first. + * For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCardsM(UFR_HANDLE hndUFR, OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + + /** + * @brief Multi reader support. Selects one of the cards which UID is on the actual UID list of the enumerated cards. If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCardM(UFR_HANDLE hndUFR, IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief Multi reader support. If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCardM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatusM(UFR_HANDLE hndUFR, VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns card type according to DlogicCardType enumeration. For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardTypeM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType); + + /** + * @brief Multi reader support. + * This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturerM(UFR_HANDLE hndUFR, OUT char* card_manufacturer_str); + + /** + * @brief Multi reader support. This function returns 8 bytes of the T2T version. All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param lpucVersionResponse[8] array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersionM(UFR_HANDLE hndUFR, OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Multi reader support. Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpulLinearSize pointer to variable which contain size of user data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSizeM(UFR_HANDLE hndUFR, VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * Multi reader support. From library version 5.0.59 and firmware version 5.0.60 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatusM(UFR_HANDLE hndUFR, OUT uint8_t *tt_message, VAR uint8_t *tt_status); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @param hndUFR handle of the uFR device + * @param data[32] Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @ingroup Card_Tag_M + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalDataM(UFR_HANDLE hndUFR, uint8_t data[32], uint32_t *len); + + /** + * @brief Multi reader support. Function returns reader’s serialized discovery loop structure i.e. C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetupM(UFR_HANDLE hndUFR, uint8_t *setupStruct, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoopM(UFR_HANDLE hndUFR, const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Multi reader support. Function returns the AID set in the reader to retrieve the mobile phone's unique ID. If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAidM(UFR_HANDLE hndUFR, uint8_t *aid, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAidM(UFR_HANDLE hndUFR, const uint8_t *aid, uint32_t len); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfigM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtpM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlotM(UFR_HANDLE hndUFR, uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKeyM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencryptedM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZoneM(UFR_HANDLE hndUFR, uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZoneM(UFR_HANDLE hndUFR, uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatusM(UFR_HANDLE hndUFR, VAR uint8_t *bool_config_zone_locked, + VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevisionM(UFR_HANDLE hndUFR, uint8_t revision[4]); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProModeM(UFR_HANDLE hndUFR, VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProModeM(UFR_HANDLE hndUFR, const uint32_t ReaderProMode); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_InitializeM(UFR_HANDLE hndUFR, IN const uint8_t *TBSerialString, uint16_t job_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCardM(UFR_HANDLE hndUFR, const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextM(UFR_HANDLE hndUFR, const uint32_t code_type, const uint32_t from_timestamp, + const uint32_t to_timestamp, const uint32_t additional_data_size, + IN const uint8_t additional_data[], VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSNM(UFR_HANDLE hndUFR, OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSNM(UFR_HANDLE hndUFR, VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSNM(UFR_HANDLE hndUFR, OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Multi reader support. Function returns TNF, type of record, ID and payload from the NDEF record. NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Multi reader support. Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, uint8_t *type_length, + IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, uint32_t *payload_length, + VAR uint8_t *card_formated); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroringM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_ttM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_countM(UFR_HANDLE hndUFR, VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, + OUT uint8_t *ndef_record_array, VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Multi reader support. Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_recordsM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initializationM(UFR_HANDLE hndUFR); + + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + + /** + * @brief Multi reader support. Function stores a message record for NTAG emulation mode into the reader. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefM(UFR_HANDLE hndUFR, uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, + uint8_t id_length, IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief Multi reader support. Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function returns current ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParamsM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. This command set ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParamsM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param is_field_present contains 0 if external field isn’t present or 1 if field is present. + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldStateM(UFR_HANDLE hndUFR, VAR uint8_t *is_field_present); + + /** + * @brief Multi reader support. Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. From library version 5.0.31, and firmware version 5.0.33 + * Function stores a message record for NTAG emulation mode into the reader in the RAM. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRamM(UFR_HANDLE hndUFR, uint8_t tnf, uint8_t *type_record, uint8_t type_length, + uint8_t *id, uint8_t id_length, uint8_t *payload, uint32_t payload_length); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking_M + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureM(UFR_HANDLE hndUFR, IN uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], + VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExtM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief Multi reader support. This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, uint32_t inc_value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successfulfunction execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterM(UFR_HANDLE hndUFR, VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RKM(UFR_HANDLE hndUFR, VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PKM(UFR_HANDLE hndUFR, VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Multi reader support. Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode + * @param card_detection_mode + * @param idle_color + * @param card_detection_color + * @param enabled + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode + * @param card_detection_mode + * @param idle_color + * @param card_detection_color + * @param enabled + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_numberM(UFR_HANDLE hndUFR, VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, VAR uint8_t *start_minute, + VAR uint8_t *end_hour, VAR uint8_t *end_minute, OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_recordM(UFR_HANDLE hndUFR, uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, + uint8_t begin_hour, uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, + uint8_t end_hour, uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_recordM(UFR_HANDLE hndUFR, VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, + VAR uint8_t *end_month, VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_typeM(UFR_HANDLE hndUFR, uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_typeM(UFR_HANDLE hndUFR, VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_durationM(UFR_HANDLE hndUFR, uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_durationM(UFR_HANDLE hndUFR, VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_durationM(UFR_HANDLE hndUFR, uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_durationM(UFR_HANDLE hndUFR, VAR uint32_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validityM(UFR_HANDLE hndUFR, VAR int32_t *credit, VAR uint32_t *begin_year, + VAR uint32_t *begin_month, VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, VAR uint32_t *end_year, VAR uint32_t *end_month, + VAR uint32_t *end_day, VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validityM(UFR_HANDLE hndUFR, int32_t credit, uint32_t begin_year, uint32_t begin_month, + uint32_t begin_day, uint32_t begin_hour, uint32_t begin_minute, uint32_t end_year, + uint32_t end_month, uint32_t end_day, uint32_t end_hour, uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint8_t *right_record_type, + OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counterM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, + uint16_t last_reader_nr, uint8_t start_hour, uint8_t start_minute, + uint8_t end_hour, uint8_t end_minute, IN uint8_t *days, + uint8_t max_daily_counter); + + //============================================================================= + + /** + * @brief Multi reader support. Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOnM(UFR_HANDLE hndUFR, uint16_t pulse_duration); + + /** + * @brief Multi reader support. Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayStateM(UFR_HANDLE hndUFR, uint8_t state); + + /** + * @brief Multi reader support. Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param intercom shows that there is voltage at the terminals for intercom connection, or not + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoStateM(UFR_HANDLE hndUFR, VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief + * Multi reader support. Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControlM(UFR_HANDLE hndUFR, uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Multi reader support. This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControlM(UFR_HANDLE hndUFR, uint8_t light_status); + + /** + * @brief Multi reader support. For classic uFR PLUS devices only. + * The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.55. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControlM(UFR_HANDLE hndUFR, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.64. + * The function sets color on the RGB diodes. This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleepM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.66. + * The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. Function also sets the number of omitted activity periods, when the RGB light is off. For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriodM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSetM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, uint8_t bad_select_nr_max); + + /** + * @brief Multi reader support. The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, VAR uint8_t *bad_select_nr_max); + + /** + * @brief Multi reader support. Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSetM(UFR_HANDLE hndUFR, uint8_t seconds_wait); + + /** + * @brief Multi reader support. Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGetM(UFR_HANDLE hndUFR, VAR uint8_t *seconds_wait); + + /** + * @brief Multi reader support. This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanentlyM(UFR_HANDLE hndUFR, unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Multi reader support. Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParametersM(UFR_HANDLE hndUFR, VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Multi reader support. Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayDataM(UFR_HANDLE hndUFR, IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Multi reader support. From version 5.0.55 + * Function has the same functionality as the function SetDisplayData. New feature is the RGB port selection. Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief Multi reader support. This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequencyM(UFR_HANDLE hndUFR, uint16_t frequency); + + /** + * @brief Multi reader support. SetRgbIntensity (alias from version 5.0.55) + * Function sets the intensity of light on the display. Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensityM(UFR_HANDLE hndUFR, uint8_t intensity); + + /** + * @brief Multi reader support. GetRgbIntensity (alias from version 5.0.55) + * Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensityM(UFR_HANDLE hndUFR, VAR uint8_t *intensity); + + // ############################################################################# + // ############################################################################# + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_ModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATSM(OUT UFR_HANDLE hndUFR, uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorageM(UFR_HANDLE hndUFR); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceiveM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint32_t *ufr_status); + /** + * @brief Multi reader support. + * Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_TransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, + uint8_t data_out_len, OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, + uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * Sends C–APDU in the c_string (zero terminated) format, containing pairs of the + hexadecimal digits. Pairs of the hexadecimal digits can be delimited by any of the punctuation + characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu + * @param *r_apdu + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceiveM(UFR_HANDLE hndUFR, IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief Multi reader support. + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are + sent and receive in the form of the byte arrays. There is obvious need for a c_apdu_len and + *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, + respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu + * @param c_apdu_len + * @param r_apdu + * @param r_apdu_len + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, + VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param c_apdu + * @param c_apdu_len + * @param r_apdu + * @param r_apdu_len + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief Multi reader support. + * This is “exploded binary” alternative function intended for support APDU commands in ISO 14443- + 4A tags. APDUTransceive() receives separated parameters which are an integral part of the C– + APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls + * @param ins + * @param p1 + * @param p2 + * @param data_out + * @param Nc + * @param data_in + * @param Ne + * @param send_le + * @param apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, + uint32_t Nc, OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chainM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceiveM(UFR_HANDLE hndUFR, uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselectM(UFR_HANDLE hndUFR, uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param card_activate + * @param card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 + * @param timeout + * @param tx_data + * @param tx_data_len + * @param rx_data + * @param rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceiveM(UFR_HANDLE hndUFR, uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, + uint8_t crypto1, uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Multi reader support. Function sets the parameters for transceive mode. If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_startM(UFR_HANDLE hndUFR, uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief Multi reader support. + * The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enableM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceiveM(UFR_HANDLE hndUFR, IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, + uint32_t bytes_to_receive, VAR uint32_t *rcv_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interfaceM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_GenericM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDUM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4M(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Using this function you can select the appropriate application on the card. For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAidM(UFR_HANDLE hndUFR, IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief Multi reader support. In JCApp cards you can put two types of asymmetric crypto keys. Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + const IN uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_type + * @param key_index + * @param key_designator + * @param key_bit_len + * @param params + * @param params_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPairM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, uint8_t key_designator, + uint16_t key_bit_len, IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBeginM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *chunk, uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdateM(UFR_HANDLE hndUFR, IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Multi reader support. Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEndM(UFR_HANDLE hndUFR, VAR uint16_t *sig_len); + + /** + * @brief Multi reader support. + * This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignatureM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *plain_data, uint16_t plain_data_len, VAR uint16_t *sig_len, + IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, + uint8_t id_size); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Multi reader support. + * Using this function you can delete certificate objects from a card. This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCertM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index); + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjIdM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + + /** + * @brief Multi reader support. + * This function is used to login to the JCApp with an appropriate PIN code. Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLoginM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief Multi reader support. This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemainingM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief Multi reader support. This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChangeM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief Multi reader support. + * This function is used to unblock PIN code which is specified by the SO parameter. + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblockM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index + * @param modulus + * @param modulus_size + * @param exponent + * @param exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, + OUT uint8_t *exponent, VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index + * @param keyW + * @param keyWSize + * @param field + * @param field_size + * @param ab + * @param ab_size + * @param g + * @param g_size + * @param r + * @param r_size + * @param k + * @param key_size_bits + * @param key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *keyW, VAR uint16_t *keyWSize, OUT uint8_t *field, + VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, + VAR uint16_t *g_size, OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, + VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); // when keyW == NULL, returns size + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index + * @param key_size_bits + * @param key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBitsM(UFR_HANDLE hndUFR, uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list_size Pointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSizeM(UFR_HANDLE hndUFR, VAR uint32_t *list_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFilesM(UFR_HANDLE hndUFR, OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief Multi reader support. + * This function returns file size indexed by the parameter card_file_index, on successful execution. Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file which size we want to get + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSizeM(UFR_HANDLE hndUFR, uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated d Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief Multi reader support. + * This function reads a file from the DLStorage card directly to the new file on the host file-system. If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. Parameter data_size defines the amount of data to be written in the file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief Multi reader support. + * This function writes file content from the host file-system to the new file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * After successful call to this function, the file on the DLStorage card will be deleted. Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFileM(UFR_HANDLE hndUFR, uint8_t file_index); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param mrz_proto_key[25] MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc[16] This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac[16] This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBacM(UFR_HANDLE hndUFR, IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], + OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * Use this function to read files from the eMRTD NFC tag. You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param file_index + * @param *output + * @param output_length + * @param ksenc[16] + * @param ksmac[16] + * @param send_sequence_cnt + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *file_index, VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * This function validates data groups read from the eMRTDocument. All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * ________________ + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param *out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc[16] Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac[16] Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidateM(UFR_HANDLE hndUFR, IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, + uint32_t verbose_level, OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + // ############################################################################# + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Start(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StartM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Stop(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StopM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Start(void); // Alias for uFR_DESFIRE_Start() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StartM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StartM() + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Stop(void); // Alias for uFR_DESFIRE_Stop() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StopM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StopM() + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUidM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3desM(UFR_HANDLE hndUFR, IN uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Provided Key mode (PK) + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function returns the available bytes on the card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param free_mem_byte pointer to free memory size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFreeMemM(UFR_HANDLE hndUFR, VAR uint32_t *free_mem_byte, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCardM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * Provided Key mode (PK) + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + /** + * @brief Multi reader support. Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Provided Key mode (PK) + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key provided key + * Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * No authentication + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + // 121212 + /** + * @brief Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. + * + * If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * Multi reader support + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationd2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfigurationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. Provided Key mode (PK) + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. No authentication + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Function allows to set card master key, and application master key configuration settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key[16] 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key[16] 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_2k3des_key_nr, uint8_t aid_key_no, uint8_t old_2k3des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_2k3des_key_nr, uint8_t aid_key_no, + uint8_t old_2k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key_nr ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_des3k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_3k3des_key_nr, uint8_t aid_key_no, + uint8_t old_3k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of the key stored in the reader + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key[16] 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key[16] 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. 128 bit AES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key[16] 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key[16] 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key[8] 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key[8] 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_des_key[8], uint8_t aid_key_no, IN uint8_t old_des_key[8], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key[16] 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key[16] 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key[8] 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key[8] 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_des_key[8], uint8_t aid_key_no, + IN uint8_t old_des_key[8], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key[16] 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key[16] 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key pointer to 32 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key[24] 24 bytes array that represent 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key[24] 24 bytes array that represent current 3K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des3k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_3k3des_key[24], uint8_t aid_key_no, + IN uint8_t old_3k3des_key[24], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key pointer to array contained new AES key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t auth_key_type, IN uint8_t *new_key, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr key index of AES key stored in the reader that will be new AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr key index of AES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeAesKey_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des3k_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_des3k_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange3k3desKey_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des3k_key_nr, uint8_t aid_key_no, uint8_t old_des3k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows you to change any AES key on the card. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. *only uFR CS with SAM support + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of a key stored in the reader that will be new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief + * Function writes AES key (16 bytes) into reader. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key in the reader (0 - 15) + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_no, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Function writes AES key (16 bytes) into reader. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param key_no ordinal number of key in the reader (0 - 15) + * @param key pointer to array containing the key + * @param key_type enumerated key type (0 - 3) + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteKeyM(UFR_HANDLE hndUFR, uint8_t key_no, IN uint8_t *key, uint8_t key_type); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIdsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_no_auth_M(UFR_HANDLE hndUFR, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t number_of_records, uint16_t record_size, uint8_t communication_settings, + uint8_t *data, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + uint8_t *data, + uint16_t *card_status, + uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuth_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileDesAuth_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile2k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. Provided Key mode (PK) + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multireader support. 128 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no ey for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsSdmAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows changing of file settings + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * *only uFR CS with SAM support + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetTransactionTimerAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). . + * + * Multi reader support. + * From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param card_uid 7 bytes length card UID + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireUidReadECCSignatureM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, OUT uint8_t *card_uid, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aesM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOnM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function prohibits the blinking of the green diode independently of the user's signaling command. LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOffM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOnM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOffM(UFR_HANDLE hndUFR); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t CWGsNOff, uint8_t ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API FastFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersM(UFR_HANDLE hndUFR, uint8_t *mui, uint8_t *serial_nr, uint8_t *hw_type, uint8_t *hw_ver, + uint8_t *device_type, uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrateM(UFR_HANDLE hndUFR, OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersPN7462_M(UFR_HANDLE hndUFR, uint8_t *die_id, uint8_t *serial_nr, + + uint8_t *hw_type, uint8_t *hw_ver, uint8_t *device_type, + uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + // SAM + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_rawM(UFR_HANDLE hndUFR, OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_versionM(UFR_HANDLE hndUFR, VAR SAM_HW_TYPE *sam_type, VAR uint8_t *sam_uid); + + /** + * @brief Multi reader support. Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_rawM(UFR_HANDLE hndUFR, uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_v ADD DESCRIPTION + * @param des_key ADD DESCRIPTION + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_desM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_keyM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param master_aes_key ADD DESCRIPTION + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_modeM(UFR_HANDLE hndUFR, IN uint8_t *master_aes_key, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plainM(UFR_HANDLE hndUFR, IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *keyA, + IN uint8_t *keyB, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_ULC_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_desfire_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, + uint8_t ver_a, IN uint8_t *aes_key_ver_b, uint8_t ver_b, + IN uint8_t *aes_key_ver_c, uint8_t ver_c, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, uint8_t sam_lock_unlock, + uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKeyM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * Multi reader support. + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeableM(UFR_HANDLE hndUFR); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * Multi reader support. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfResetM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOnM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch off RF field at the reader. + * + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOffM(UFR_HANDLE hndUFR); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderIdM(UFR_HANDLE hndUFR, uint8_t *reader_id); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePersoM(UFR_HANDLE hndUFR, uint16_t address, IN uint8_t *data); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPersoM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param card_master_key pointer to 16 byte array containing the card master key + * @param card_config_key pointer to 16 byte array containing the card configuration key + * @param level_2_switch_key pointer to 16 byte array containing the key for switch to security level 2 + * @param level_3_switch_key pointer to 16 byte array containing the key for switch to security level 3 + * @param level_1_auth_key pointer to 16 byte array containing the key for optional authentication at security level 1 + * @param select_vc_key pointer to 16 byte array containing the key for virtual card selection + * @param prox_chk_key pointer to 16 byte array containing the key for proximity check + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling + * @param vc_poll_mac_key pointer to 16 byte array containing the MAC key for virtual card polling + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimalM(UFR_HANDLE hndUFR, IN uint8_t *card_master_key, IN uint8_t *card_config_key, + IN uint8_t *level_2_switch_key, IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, + IN uint8_t *select_vc_key, IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, + IN uint8_t *vc_poll_mac_key); + + /** + * @brief Multi reader support. Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, + uint8_t prox_check_use); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ADordinary number of current sector key stored into reader that wile become new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKeyM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, + OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @param hndUFR handle of the uFR device + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PKM(UFR_HANDLE hndUFR, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief Multi reader support. Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PKM(UFR_HANDLE hndUFR, IN uint8_t *key); + + /** + * @brief Multi reader support. No authentication + * This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_authM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + // ESP32 + /** + * @brief Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. + * + * Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayData(IN uint8_t *display_data, IN uint8_t data_length, uint16_t duration); + + /** + * @brief Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderReset(void); + + /** + * @brief It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM of uFR Online. + * + * Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param time pointer to the array containing current date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTime(OUT uint8_t *time); + + /** + * @brief Function sets the date and time into uFR Online RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOState(uint8_t pin, uint8_t state); + + /** + * @brief Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOState(OUT uint8_t *state); + + /** + * @brief Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReader(uint8_t reader); + + /** + * @brief Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param SerialNumber pointer to SerialNumber variable. “SerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumber(VAR uint32_t *SerialNumber); + + // NDEF MESSAGES + //---------------------------------------------------------- + + enum NDEF_STORAGE_MODE + { + STORE_INTO_READER = 0, + STORE_INTO_CARD + }; + + enum NDEF_SKYPE_ACTION + { + CALL = 0, + CHAT + }; + + // WiFi NDEF authentication type + enum WIFI_AUTH_TYPE + { + OPEN = 0, + WPA_PERSONAL, + WPA_ENTERPRISE, + WPA2_ENTERPRISE, + WPA2_PERSONAL + }; + + // WiFi NDEF encryption type + enum WIFI_ENC_TYPE + { + NONE = 0, + WEP, + TKIP, + AES, + AES_TKIP + }; + + /** + * @brief + * Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFi(uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, uint8_t encryption_type, + IN const char *password); + + /** + * @brief Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters)(e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BT(uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMS(uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Bitcoin(uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocation(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestination(uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Email(uint8_t ndef_storage, IN const char *email_address, IN const char *subject, IN const char *message); + + /** + * @brief Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Address(uint8_t ndef_storage, IN const char *address); + + /** + * @brief Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidApp(uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Store text as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Text(uint8_t ndef_storage, IN const char *text); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetView(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Skype(uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Whatsapp(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Viber(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Contact(uint8_t ndef_storage, IN const char *name, IN const char *company, IN const char *address, + IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Phone(uint8_t ndef_storage, IN const char *phone_number); + + /** + * @brief Multi reader support. Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFiM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, + uint8_t encryption_type, IN const char *password); + + /** + * @brief Multi reader support. Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters) (e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BTM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Multi reader support. Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMSM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Multi reader support. Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BitcoinM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Multi reader support. Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_EmailM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *email_address, IN const char *subject, + IN const char *message); + + /** + * @brief Multi reader support. Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AddressM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *address); + + /** + * @brief Multi reader support. Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Multi reader support. Store text as NDEF message into reader or into card. + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_TextM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *text); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetViewM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SkypeM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Multi reader support. Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WhatsappM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ViberM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ContactM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *name, IN const char *company, + IN const char *address, IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Multi reader support. Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_PhoneM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number); + //--------------------------------------------------------------------------------------------- + /** + * @brief Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF + * + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFi(OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, OUT char *password); + + /** + * @brief Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Bitcoin(OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocation(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF + * + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestination(OUT char *destination); + + /** + * @brief Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Email(OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF + * + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Address(OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF + * + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidApp(OUT char *package_name); + + /** + * @brief Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF + * + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Text(OUT char *text); + + /** + * @brief Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetView(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF + * + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Skype(OUT char *user_name, OUT char *action); + + /** + * @brief Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Whatsapp(OUT char *message); + + /** + * @brief Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Viber(OUT char *message); + + /** + * @brief Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF + * + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Contact(OUT char *vCard); + + /** + * @brief Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Phone(OUT char *phone_number); + + /** + * @brief Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMS(OUT char *phone_number, OUT char *message); + + /** + * @brief Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BT(OUT char *bt_mac_address); + + /** + * @brief Multi reader support. Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFiM(UFR_HANDLE hndUFR, OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, + OUT char *password); + + /** + * @brief Multi reader support. Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BitcoinM(UFR_HANDLE hndUFR, OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, OUT char *destination); + + /** + * @brief Multi reader support. Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_EmailM(UFR_HANDLE hndUFR, OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AddressM(UFR_HANDLE hndUFR, OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, OUT char *package_name); + + /** + * @brief Multi reader support. Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_TextM(UFR_HANDLE hndUFR, OUT char *text); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetViewM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SkypeM(UFR_HANDLE hndUFR, OUT char *user_name, OUT char *action); + + /** + * @brief Multi reader support. Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WhatsappM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ViberM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ContactM(UFR_HANDLE hndUFR, OUT char *vCard); + + /** + * @brief Multi reader support. Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_PhoneM(UFR_HANDLE hndUFR, OUT char *phone_number); + + /** + * @brief Multi reader support. Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMSM(UFR_HANDLE hndUFR, OUT char *phone_number, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BTM(UFR_HANDLE hndUFR, OUT char *bt_mac_address); + + /** + * @brief Used to parse NDEF record into separate parameters + * + * @ingroup Card_Tag_NDEF + * + * @param type_record pointer to the array containing record type + * @param type_len length of the record type + * @param payload pointer to the array containing record payload + * @param payload_len length of the record payload + * + * @return Operation status + */ + c_string DL_API ParseNdefMessage(IN uint8_t *type_record, uint8_t type_len, IN uint8_t *payload, uint32_t payload_len); + + // NT4H + + /** + * @brief Multi reader support. Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parametersM(UFR_HANDLE hndUFR, uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function returns file settings. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext); + + /** + * @brief Multi reader support. Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_ridM(UFR_HANDLE hndUFR, uint8_t aes_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uidM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_keyM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctrM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. No authentication + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_authM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signatureM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_statusM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_authM(UFR_HANDLE hndUFR, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_ttM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_fileM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief Multi reader support. Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint16_t duration); + + /** + * @brief Multi reader support. Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPasswordM(UFR_HANDLE hndUFR, uint8_t *old_password, uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM of uFR Online. Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWriteM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size, uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromReadM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into uFR Online RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *password, uint8_t *time); + + /** + * @brief Multi reader support. Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOStateM(UFR_HANDLE hndUFR, uint8_t pin, uint8_t state); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOStateM(UFR_HANDLE hndUFR, uint8_t *state); + + /** + * @brief Multi reader support. Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReaderM(UFR_HANDLE hndUFR, uint8_t reader); + + /** + * @brief Multi reader support. Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumberM(UFR_HANDLE hndUFR, uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + UFR_STATUS DL_API COMTransceiveM(UFR_HANDLE hndUFR, IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General + * + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + UFR_STATUS DL_API COMTransceive(IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + // DLL version ---------------------------------------------------------------- + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + uint32_t DL_API GetDllVersion(void); + + /* + * Get "exploded" dll version example: + * + * #include + * #include + * + * void main(int argc, char *argv[]) + * { + * uint32_t dwDllVersion = 0; + * uint32_t dwDllMajorVersion = 0; + * uint32_t dwDllMinorVersion = 0; + * uint32_t dwDllBuild = 0; + * + * dwDllVersion = GetDllVersion(); + * + * // "explode" the dll version: + * dwDllMajorVersion = (DWORD)(LOBYTE(LOWORD(dwDllVersion))); + * dwDllMinorVersion = (DWORD)(HIBYTE(LOWORD(dwDllVersion))); + * + * // Get the dll build number. + * dwDllBuild = (DWORD)(HIWORD(dwDllVersion)); + * + * printf("Dll version is %ld.%ld (%ld)\n", dwDllMajorVersion, + * dwDllMinorVersion, + * dwDllBuild); + * } + * + */ + // Originality Check (performs the check is the chip on the card/tag NXP genuine): + /** + * @brief This function depends on OpenSSL crypto library. Since OpenSSL crypto library is dynamically linked during execution, the only prerequisite for a successful call to this function is that the libeay32.dll is in the current folder (valid for Windows) and / or libcrypto.so is in the environment path (e.g. LD_LIBRARY_PATH on Linux / macOS). OriginalityCheck() performs the check if the chip on the card / tag is NXP genuine. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param signature ECCSignature acquired by call to the ReadECCSignature() function. + * @param uid Card UID. Best if the card UID is acquired by previous call to the ReadECCSignature() function. + * @param uid_len Card UID length. Best if the card UID length is acquired by previous call to the ReadECCSignature() function. + * @param DlogicCardType Card type. Best if the DlogicCardType is acquired by previous call to the ReadECCSignature() function. + * + * @return Operation status + */ + UFR_STATUS DL_API OriginalityCheck(IN const uint8_t *signature, IN const uint8_t *uid, uint8_t uid_len, uint8_t DlogicCardType); + // Returns: + // UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND in case there is no OpenSSL library (libeay32.dll) in current folder or path + // UFR_OPEN_SSL_DYNAMIC_LIB_FAILED in case of OpenSSL library error (e.g. wrong OpenSSL version) + // UFR_NOT_NXP_GENUINE if chip on the card/tag is NOT NXP genuine + // UFR_OK is chip on the card/tag is NXP GENUINE + + //// debug functions: + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + c_string DL_API GetDllVersionStr(void); + + /** + * @brief Returns UFR_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param status UFR_STATUS status variable + * + * @return Operation status + */ + c_string DL_API UFR_Status2String(const UFR_STATUS status); + + /** + * @brief Returns card type as a c_string instead of byte value + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param dl_type_code card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + c_string DL_API UFR_DLCardType2String(uint8_t dl_type_code); + +//// Helper functions: +#ifndef _WIN32 + + unsigned long GetTickCount(void); + +#endif // #ifndef _WIN32 + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information + * + * @return The reader's descriptive name + */ + c_string DL_API GetReaderDescription(void); + + /** + * @brief Multi reader support. This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * + * @return Teturns the reader's descriptive name. + */ + c_string DL_API GetReaderDescriptionM(UFR_HANDLE hndUFR); + +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +#ifdef __ANDROID__ +#include + + extern JNIEnv *global_env; + extern jclass global_class; + extern jclass usb_global_class; + + /** + + * + * @param env + * @param class1 + * + * @return Operation status + */ + void DL_API initVM(JNIEnv *env, jclass class1); +#endif + +#ifdef __APPLE__ +#include +#if TARGET_OS_IPHONE + void setNFCMessage(char *message); +#endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* uFCoder_H_ */ diff --git a/lib/esp32/lib/libufcoder.a b/lib/esp32/lib/libufcoder.a new file mode 100644 index 0000000000000000000000000000000000000000..909d8138c2eeac123c9824c892e6c1016dc8a7de Binary files /dev/null and b/lib/esp32/lib/libufcoder.a differ diff --git a/lib/include/uFCoder.h b/lib/include/uFCoder.h new file mode 100644 index 0000000000000000000000000000000000000000..36161350bfe852aa30b90a0b62592ddfb2b7584f --- /dev/null +++ b/lib/include/uFCoder.h @@ -0,0 +1,49514 @@ +/* + * uFCoder.h + * + * library version: 6.0.10 + * + * Created on: 2009-01-14 + * Last edited: 2025-03-06 + * + * Author: D-Logic + */ +#ifndef uFCoder_H_ +#define uFCoder_H_ + +#include +#include +#include + +#define IN // array that you pass to function +#define OUT // array that you receive from function +#define VAR // first element of array that you receive from function (single variable) + +//////////////////////////////////////////////////////////////////// +/** + * Type for representing null terminated char array ( aka C-String ) + * Array is always one byte longer ( for null character ) then string + * Memory space for array must be allocated before use. + */ +typedef const char *c_string; +//////////////////////////////////////////////////////////////////// + +#ifdef _WIN32 +// WINDOWS +#if defined(DL_CREATE_STATIC_LIB) || defined(DL_USE_STATIC_LIB) +#define DL_API +#else +#ifndef DL_uFC_EXPORTS +#ifdef _WIN_IOT +#define DL_API __declspec(dllimport) // Win IoT +#else +#define DL_API /*__declspec(dllimport) */ __stdcall // STDCALL - GCC - .NET +#endif // _WIN_IOT +#else +#define DL_API __declspec(dllexport) __stdcall +#endif // DL_uFC_EXPORTS +#endif // DL_CREATE_STATIC_LIB +#else +// Linux & MAC OS +#define DL_API +#endif // _WIN32 + +#if defined(DL_uFC_EXPORTS) || defined(DL_CREATE_STATIC_LIB) || defined(__ANDROID__) || defined(ESP_PLATFORM) || defined(IOS_PLATFORM) +typedef struct S_UFR_HANDLE *UFR_HANDLE; +#else +typedef void *UFR_HANDLE; +#endif + +// MIFARE CLASSIC type id's: +#define MIFARE_CLASSIC_1k 0x08 +#define MF1ICS50 0x08 +#define SLE66R35 0x88 // Infineon = Mifare Classic 1k +#define MIFARE_CLASSIC_4k 0x18 +#define MF1ICS70 0x18 +#define MIFARE_CLASSIC_MINI 0x09 +#define MF1ICS20 0x09 + +// DLOGIC CARD TYPE +#define TAG_UNKNOWN 0 +#define DL_MIFARE_ULTRALIGHT 0x01 +#define DL_MIFARE_ULTRALIGHT_EV1_11 0x02 +#define DL_MIFARE_ULTRALIGHT_EV1_21 0x03 +#define DL_MIFARE_ULTRALIGHT_C 0x04 +#define DL_NTAG_203 0x05 +#define DL_NTAG_210 0x06 +#define DL_NTAG_212 0x07 +#define DL_NTAG_213 0x08 +#define DL_NTAG_215 0x09 +#define DL_NTAG_216 0x0A +#define DL_MIKRON_MIK640D 0x0B +#define NFC_T2T_GENERIC 0x0C +#define DL_NT3H_1101 0x0D +#define DL_NT3H_1201 0x0E +#define DL_NT3H_2111 0x0F +#define DL_NT3H_2211 0x10 +#define DL_NTAG_413_DNA 0x11 +#define DL_NTAG_424_DNA 0x12 +#define DL_NTAG_424_DNA_TT 0x13 +#define DL_NTAG_210U 0x14 +#define DL_NTAG_213_TT 0x15 + +#define DL_MIFARE_CLASSIC_2K 0x19 +#define DL_MIFARE_MINI 0x20 +#define DL_MIFARE_CLASSIC_1K 0x21 +#define DL_MIFARE_CLASSIC_4K 0x22 +#define DL_MIFARE_PLUS_S_2K_SL0 0x23 +#define DL_MIFARE_PLUS_S_4K_SL0 0x24 +#define DL_MIFARE_PLUS_X_2K_SL0 0x25 +#define DL_MIFARE_PLUS_X_4K_SL0 0x26 +#define DL_MIFARE_DESFIRE 0x27 +#define DL_MIFARE_DESFIRE_EV1_2K 0x28 +#define DL_MIFARE_DESFIRE_EV1_4K 0x29 +#define DL_MIFARE_DESFIRE_EV1_8K 0x2A +#define DL_MIFARE_DESFIRE_EV2_2K 0x2B +#define DL_MIFARE_DESFIRE_EV2_4K 0x2C +#define DL_MIFARE_DESFIRE_EV2_8K 0x2D +#define DL_MIFARE_PLUS_S_2K_SL1 0x2E +#define DL_MIFARE_PLUS_X_2K_SL1 0x2F +#define DL_MIFARE_PLUS_EV1_2K_SL1 0x30 +#define DL_MIFARE_PLUS_X_2K_SL2 0x31 +#define DL_MIFARE_PLUS_S_2K_SL3 0x32 +#define DL_MIFARE_PLUS_X_2K_SL3 0x33 +#define DL_MIFARE_PLUS_EV1_2K_SL3 0x34 +#define DL_MIFARE_PLUS_S_4K_SL1 0x35 +#define DL_MIFARE_PLUS_X_4K_SL1 0x36 +#define DL_MIFARE_PLUS_EV1_4K_SL1 0x37 +#define DL_MIFARE_PLUS_X_4K_SL2 0x38 +#define DL_MIFARE_PLUS_S_4K_SL3 0x39 +#define DL_MIFARE_PLUS_X_4K_SL3 0x3A +#define DL_MIFARE_PLUS_EV1_4K_SL3 0x3B +#define DL_MIFARE_PLUS_SE_SL0 0x3C +#define DL_MIFARE_PLUS_SE_SL1 0x3D +#define DL_MIFARE_PLUS_SE_SL3 0x3E +#define DL_MIFARE_DESFIRE_LIGHT 0x3F + +#define DL_UNKNOWN_ISO_14443_4 0x40 +#define DL_GENERIC_ISO14443_4 0x40 +#define DL_GENERIC_ISO14443_4_TYPE_B 0x41 +#define DL_GENERIC_ISO14443_3_TYPE_B 0x42 +#define DL_MIFARE_PLUS_EV1_2K_SL0 0x43 +#define DL_MIFARE_PLUS_EV1_4K_SL0 0x44 +#define DL_MIFARE_DESFIRE_EV3_2K 0x45 +#define DL_MIFARE_DESFIRE_EV3_4K 0x46 +#define DL_MIFARE_DESFIRE_EV3_8K 0x47 + +#define DL_MOBILE_AID 0x60 +#define DL_APPLE_VAS_V1 0x6A +#define DL_APPLE_VAS_V2 0x6B +#define DL_IMEI_UID 0x80 + +// ST Product ID-s: +#define M24SR02 0x82 +#define M24SR02_AUTOMOTIVE 0x8A +#define M24SR04 0x86 +#define M24SR04_AUTOMOTIVE 0x8E +#define M24SR16 0x85 +#define M24SR16_AUTOMOTIVE 0x8D +#define M24SR64 0x84 +#define M24SR64_AUTOMOTIVE 0x8C + +// DLJavaCardTypes: +#define DLSigner81 0xA0 +#define DLSigner22 0xA1 +#define DLSigner30 0xA2 +#define DLSigner10 0xA3 +#define DLSigner145 0xAA + +enum E_CARD_IN_SAM_SLOT +{ + SAM_SLOT_MIFARE_SAM_AV2 = 1, + SAM_SLOT_GENERIC = 4 +}; + +// DLJavaCardSignerAlgorithmTypes: +enum E_SIGNER_CIPHERS +{ + SIG_CIPHER_RSA = 0, + SIG_CIPHER_ECDSA, + + SIG_CIPHER_MAX_SUPPORTED +}; + +enum E_SIGNER_RSA_PADDINGS +{ + PAD_NULL = 0, + PAD_PKCS1_V1_5, + PAD_PKCS1_PSS, + + SIG_PAD_MAX_SUPPORTED +}; +#define PAD_PKCS1 PAD_PKCS1_V1_5 + +enum E_SIGNER_DIGESTS +{ + ALG_NULL = 0, + ALG_SHA, + ALG_SHA_256, + ALG_SHA_384, + ALG_SHA_512, + ALG_SHA_224, + ALG_SHA_512_224, + ALG_SHA_512_256, + + SIG_DIGEST_MAX_SUPPORTED +}; + +enum E_KEY_TYPES +{ + TYPE_RSA_PRIVATE = 0, + TYPE_RSA_CRT_PRIVATE, + TYPE_EC_F2M_PRIVATE, + TYPE_EC_FP_PRIVATE +}; + +enum E_OBJ_TYPES +{ + OBJ_TYPE_RSA_CERT = 0, + OBJ_TYPE_EC_CERT, + OBJ_TYPE_CA_CERT, + + OBJ_TYPES_COUNT +}; + +// JCDL_AIDs +#define DL_RAW_SIZEOF_SZ(x) (sizeof(x) - 1) +#define DL_AID_RID_PLUS "\xF0" "DLogic" +#define DL_SIGNER_PIX "\x00\x01" +#define DL_STORAGE_PIX "\x01\x01" +#define DL_SIGNER_AID DL_AID_RID_PLUS DL_SIGNER_PIX +#define DL_SIGNER_AID_SIZE 9 +#define DL_STORAGE_AID DL_AID_RID_PLUS DL_STORAGE_PIX +#define DL_STORAGE_AID_SIZE 9 + +// Universal JCDL instructions: +#define INS_LOGIN 0x20 +#define INS_GET_PIN_TRIES_REMAINING 0x21 +#define INS_PIN_CHANGE 0x22 +#define INS_PIN_UNBLOCK 0x23 + +// JCDLStorage instructions: +#define INS_PIN_ENABLE 0x24 +#define INS_PIN_DISABLE 0x25 +#define INS_LIST_FILES 0x31 +#define INS_GET_FILE_SIZE 0x32 +#define INS_READ_FILE 0x33 +#define INS_WRITE_FILE 0x34 +#define INS_DELETE_FILE 0x3F + +// JCDLSigner instructions: +#define INS_SET_RSA_PRIKEY 0x51 +#define INS_GEN_RSA_KEY_PAIR 0x52 +#define INS_GET_RSA_PUBKEY_MODULUS 0x53 +#define INS_GET_RSA_PUBKEY_EXPONENT 0x54 +#define INS_DEL_RSA_KEY_PAIR 0x5F +#define INS_SET_EC_PRIKEY 0x61 +#define INS_GEN_EC_KEY_PAIR 0x62 +#define INS_GET_EC_PUBKEY 0x63 +#define INS_GET_EC_FIELD 0x64 +#define INS_GET_EC_AB 0x65 +#define INS_GET_EC_G 0x66 +#define INS_GET_EC_RK_SIZE 0x67 +#define INS_DEL_EC_KEY_PAIR 0x6F +#define INS_GET_SIGNATURE 0x71 +#define INS_PUT_OBJ 0x31 +#define INS_PUT_OBJ_SUBJECT 0x32 +#define INS_INVALIDATE_CERT 0x33 +#define INS_GET_OBJ 0x41 +#define INS_GET_OBJ_ID 0x42 +#define INS_GET_OBJ_SUBJECT 0x43 + +// Universal JCDL constants: +#define PIN_MAX_TRIES 5 +#define PIN_MIN_LENGTH 4 +#define PIN_MAX_LENGTH 8 +#define PUK_MAX_TRIES 10 +#define PUK_LENGTH 8 + +// JCDLSigner constants: +#define JC_APP_MAX_KEY_INDEX ((3) - 1) +#define JC_APP_MAX_CA_CERT_INDEX ((12) - 1) +#define JC_APP_MAX_ID_SIZE 253 +#define JC_APP_MAX_SUBJECT_SIZE 255 +#define JC_APP_MAX_SIGNATURE_LEN 256 +#define JC_APP_MAX_PIN_LENGTH 8 + +// JCDLStorage constants: +#define JC_DL_STORAGE_MAX_FILES 16 +#define JC_DL_STORAGE_MAX_FILE_SIZE (32 * 1024 - 2) // 32KB - 2 byte system reserved + +// MIFARE CLASSIC Authentication Modes: +enum MIFARE_AUTHENTICATION +{ + MIFARE_AUTHENT1A = 0x60, + MIFARE_AUTHENT1B = 0x61, +}; + +// MIFARE PLUS AES Authentication Modes: +enum MIFARE_PLUS_AES_AUTHENTICATION +{ + MIFARE_PLUS_AES_AUTHENT1A = 0x80, + MIFARE_PLUS_AES_AUTHENT1B = 0x81, +}; + +enum MIFARE_PLUS_AES_KEY_TYPE +{ + MIFARE_PLUS_AES_KEY_A = 1, + MIFARE_PLUS_AES_KEY_B = 2, +}; + +// T2T authentication constants: +enum T2T_AUTHENTICATION +{ + T2T_NO_PWD_AUTH = 0, + T2T_RKA_PWD_AUTH = 1, + T2T_PK_PWD_AUTH = 3, + T2T_WITHOUT_PWD_AUTH = 0x60, + T2T_WITH_PWD_AUTH = 0x61, +}; + +// T4T authentication constants +enum T4T_AUTHENTICATION +{ + T4T_WITHOUT_PWD_AUTH = 0x60, + T4T_PK_PWD_AUTH = 0x80, + T4T_RKA_PWD_AUTH = 0x02, +}; + +enum ADDRESS_MODE +{ + ADDRESS_MODE_BLOCK = 0, + ADDRESS_MODE_SECTOR, +}; + +#define MAX_UID_LEN 10 +#define MAX_ATS_LEN 25 +#define ECC_SIG_LEN 32 + +// API Status Codes Type: +typedef enum UFCODER_ERROR_CODES +{ + UFR_OK = 0x00, + UFR_COMMUNICATION_ERROR = 0x01, + UFR_CHKSUM_ERROR = 0x02, + UFR_READING_ERROR = 0x03, + UFR_WRITING_ERROR = 0x04, + UFR_BUFFER_OVERFLOW = 0x05, + UFR_MAX_ADDRESS_EXCEEDED = 0x06, + UFR_MAX_KEY_INDEX_EXCEEDED = 0x07, + UFR_NO_CARD = 0x08, + UFR_COMMAND_NOT_SUPPORTED = 0x09, + UFR_FORBIDEN_DIRECT_WRITE_IN_SECTOR_TRAILER = 0x0A, + UFR_ADDRESSED_BLOCK_IS_NOT_SECTOR_TRAILER = 0x0B, + UFR_WRONG_ADDRESS_MODE = 0x0C, + UFR_WRONG_ACCESS_BITS_VALUES = 0x0D, + UFR_AUTH_ERROR = 0x0E, + UFR_PARAMETERS_ERROR = 0x0F, + UFR_MAX_SIZE_EXCEEDED = 0x10, + UFR_UNSUPPORTED_CARD_TYPE = 0x11, + + UFR_COMMUNICATION_BREAK = 0x50, + UFR_NO_MEMORY_ERROR = 0x51, + UFR_CAN_NOT_OPEN_READER = 0x52, + UFR_READER_NOT_SUPPORTED = 0x53, + UFR_READER_OPENING_ERROR = 0x54, + UFR_READER_PORT_NOT_OPENED = 0x55, + UFR_CANT_CLOSE_READER_PORT = 0x56, + UFR_BLE_INVALID_PAIRING = 0x57, + + UFR_I2C_BUS_ERROR = 0x6A, + UFR_ECC_STORAGE_ERROR = 0x6B, + + UFR_WRITE_VERIFICATION_ERROR = 0x70, + UFR_BUFFER_SIZE_EXCEEDED = 0x71, + UFR_VALUE_BLOCK_INVALID = 0x72, + UFR_VALUE_BLOCK_ADDR_INVALID = 0x73, + UFR_VALUE_BLOCK_MANIPULATION_ERROR = 0x74, + UFR_WRONG_UI_MODE = 0x75, + UFR_KEYS_LOCKED = 0x76, + UFR_KEYS_UNLOCKED = 0x77, + UFR_WRONG_PASSWORD = 0x78, + UFR_CAN_NOT_LOCK_DEVICE = 0x79, + UFR_CAN_NOT_UNLOCK_DEVICE = 0x7A, + UFR_DEVICE_EEPROM_BUSY = 0x7B, + UFR_RTC_SET_ERROR = 0x7C, + + ANTI_COLLISION_DISABLED = 0x7D, + NO_TAGS_ENUMERRATED = 0x7E, + CARD_ALREADY_SELECTED = 0x7F, + + // NDEF error codes + UFR_WRONG_NDEF_CARD_FORMAT = 0x80, + UFR_NDEF_MESSAGE_NOT_FOUND = 0x81, + UFR_NDEF_UNSUPPORTED_CARD_TYPE = 0x82, + UFR_NDEF_CARD_FORMAT_ERROR = 0x83, + UFR_MAD_NOT_ENABLED = 0x84, + UFR_MAD_VERSION_NOT_SUPPORTED = 0x85, + UFR_NDEF_MESSAGE_NOT_COMPATIBLE = 0x86, + + // Tag emulation mode errors: + FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90, + + // FTDI errors: + UFR_FT_STATUS_ERROR_1 = 0xA0, + UFR_FT_STATUS_ERROR_2 = 0xA1, + UFR_FT_STATUS_ERROR_3 = 0xA2, + UFR_FT_STATUS_ERROR_4 = 0xA3, + UFR_FT_STATUS_ERROR_5 = 0xA4, + UFR_FT_STATUS_ERROR_6 = 0xA5, + UFR_FT_STATUS_ERROR_7 = 0xA6, + UFR_FT_STATUS_ERROR_8 = 0xA7, + UFR_FT_STATUS_ERROR_9 = 0xA8, + + // MIFARE PLUS error codes + UFR_MFP_COMMAND_OVERFLOW = 0xB0, + UFR_MFP_INVALID_MAC = 0xB1, + UFR_MFP_INVALID_BLOCK_NR = 0xB2, + UFR_MFP_NOT_EXIST_BLOCK_NR = 0xB3, + UFR_MFP_COND_OF_USE_ERROR = 0xB4, + UFR_MFP_LENGTH_ERROR = 0xB5, + UFR_MFP_GENERAL_MANIP_ERROR = 0xB6, + UFR_MFP_SWITCH_TO_ISO14443_4_ERROR = 0xB7, + UFR_MFP_ILLEGAL_STATUS_CODE = 0xB8, + UFR_MFP_MULTI_BLOCKS_READ = 0xB9, + + // NT4H error codes + NT4H_COMMAND_ABORTED = 0xC0, + NT4H_LENGTH_ERROR = 0xC1, + NT4H_PARAMETER_ERROR = 0xC2, + NT4H_NO_SUCH_KEY = 0xC3, + NT4H_PERMISSION_DENIED = 0xC4, + NT4H_AUTHENTICATION_DELAY = 0xC5, + NT4H_MEMORY_ERROR = 0xC6, + NT4H_INTEGRITY_ERROR = 0xC7, + NT4H_FILE_NOT_FOUND = 0xC8, + NT4H_BOUNDARY_ERROR = 0xC9, + NT4H_INVALID_MAC = 0xCA, + NT4H_NO_CHANGES = 0xCB, + + // multiple units - return from the functions with ReaderList_ prefix in name + UFR_DEVICE_WRONG_HANDLE = 0x100, + UFR_DEVICE_INDEX_OUT_OF_BOUND, + UFR_DEVICE_ALREADY_OPENED, + UFR_DEVICE_ALREADY_CLOSED, + UFR_DEVICE_IS_NOT_CONNECTED, + + // Originality Check Error Codes: + UFR_NOT_NXP_GENUINE = 0x200, + UFR_OPEN_SSL_DYNAMIC_LIB_FAILED, + UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND, + + // DESFIRE Card Status Error Codes: + READER_ERROR = 0xBB7, // 2999 [dec] + NO_CARD_DETECTED = 0xBB8, // 3000 [dec] + CARD_OPERATION_OK = 0xBB9, // 3001 [dec] + WRONG_KEY_TYPE = 0xBBA, // 3002 [dec] + KEY_AUTH_ERROR = 0xBBB, // 3003 [dec] + CARD_CRYPTO_ERROR = 0xBBC, // 3004 [dec] + READER_CARD_COMM_ERROR = 0xBBD, // 3005 [dec] + PC_READER_COMM_ERROR = 0xBBE, // 3006 [dec] + COMMIT_TRANSACTION_NO_REPLY = 0xBBF, // 3007 [dec] + COMMIT_TRANSACTION_ERROR = 0xBC0, // 3008 [dec] + NOT_SUPPORTED_KEY_TYPE = 0xBC2, // 3010 [dec] + WRONG_FILE_TYPE = 0xBC3, // 3011 [dec] + + DESFIRE_CARD_NO_CHANGES = 0x0C0C, + DESFIRE_CARD_OUT_OF_EEPROM_ERROR = 0x0C0E, + DESFIRE_CARD_ILLEGAL_COMMAND_CODE = 0x0C1C, + DESFIRE_CARD_INTEGRITY_ERROR = 0x0C1E, + DESFIRE_CARD_NO_SUCH_KEY = 0x0C40, + DESFIRE_CARD_LENGTH_ERROR = 0x0C7E, + DESFIRE_CARD_PERMISSION_DENIED = 0x0C9D, + DESFIRE_CARD_PARAMETER_ERROR = 0x0C9E, + DESFIRE_CARD_APPLICATION_NOT_FOUND = 0x0CA0, + DESFIRE_CARD_APPL_INTEGRITY_ERROR = 0x0CA1, + DESFIRE_CARD_AUTHENTICATION_ERROR = 0x0CAE, + DESFIRE_CARD_ADDITIONAL_FRAME = 0x0CAF, + DESFIRE_CARD_BOUNDARY_ERROR = 0x0CBE, + DESFIRE_CARD_PICC_INTEGRITY_ERROR = 0x0CC1, + DESFIRE_CARD_COMMAND_ABORTED = 0x0CCA, + DESFIRE_CARD_PICC_DISABLED_ERROR = 0x0CCD, + DESFIRE_CARD_COUNT_ERROR = 0x0CCE, + DESFIRE_CARD_DUPLICATE_ERROR = 0x0CDE, + DESFIRE_CARD_EEPROM_ERROR_DES = 0x0CEE, + DESFIRE_CARD_FILE_NOT_FOUND = 0x0CF0, + DESFIRE_CARD_FILE_INTEGRITY_ERROR = 0x0CF1, + DESFIRE_CATD_AUTHENTICATION_DELAY = 0X0CAD, + + // uFCoder library errors: + UFR_NOT_IMPLEMENTED = 0x1000, + UFR_COMMAND_FAILED = 0x1001, + UFR_TIMEOUT_ERR = 0x1002, + UFR_FILE_SYSTEM_ERROR = 0x1003, + UFR_FILE_SYSTEM_PATH_NOT_EXISTS = 0x1004, + UFR_FILE_NOT_EXISTS = 0x1005, + UFR_FTD2XX_DLL_NOT_FOUND = 0x1006, + + // uFCoder library/licensing specific + UFR_JSON_INVALID = 0x1012, + UFR_LICENSE_INVALID = 0x1013, + UFR_LICENSE_SAVE_FAILED = 0x1014, + UFR_LICENSE_NOT_FOUND = 0x1015, + UFR_LICENSE_HAS_EXPIRED = 0x1016, + + // SAM module error codes: + UFR_SAM_APDU_ERROR = 0x2000, + UFR_SAM_AUTH_ERROR, + UFR_SAM_CRYPTO_ERROR, + + // TLS, HTTPS Error Codes: + TLS_ERR_OPENING_SOCKET = 0x5000, + TLS_ERR_NO_SUCH_HOST = 0x5001, + TLS_CONNECTING_ERROR = 0x5002, + TLS_ERR_SERVER_UNEXPECTEDLY_CLOSED_CONNECTION = 0x5003, + TLS_ERR_UNKNOWN_GIDS_CERTIFICATE_FORMAT = 0x5004, + TLS_ERR_SET_PIN_FOR_GIDS_CERT_ONLY = 0x5005, + TLS_ERR_GIDS_PIN_CODE_WRONG = 0x5006, + TLS_ERR_UNSUPPORTED_CERTIFICATE_TYPE = 0x5007, + TLS_ERR_PRIVATE_KEY_CONTEXT_WRONG = 0x5008, + + // JC cards APDU Error Codes: + UFR_APDU_TRANSCEIVE_ERROR = 0xAE, + UFR_APDU_JC_APP_NOT_SELECTED = 0x6000, + UFR_APDU_JC_APP_BUFF_EMPTY = 0x6001, + UFR_APDU_WRONG_SELECT_RESPONSE = 0x6002, + UFR_APDU_WRONG_KEY_TYPE = 0x6003, + UFR_APDU_WRONG_KEY_SIZE = 0x6004, + UFR_APDU_WRONG_KEY_PARAMS = 0x6005, + UFR_APDU_WRONG_SIGNING_ALGORITHM = 0x6006, + UFR_APDU_PLAIN_TEXT_MAX_SIZE_EXCEEDED = 0x6007, + UFR_APDU_UNSUPPORTED_KEY_SIZE = 0x6008, + UFR_APDU_UNSUPPORTED_ALGORITHMS = 0x6009, + UFR_APDU_PKI_OBJECT_NOT_FOUND = 0x600A, + UFR_APDU_MAX_PIN_LENGTH_EXCEEDED = 0x600B, + UFR_DIGEST_LENGTH_DOES_NOT_MATCH = 0x600C, + + // reserved: 0x6100, + CRYPTO_SUBSYS_NOT_INITIALIZED = 0x6101, + CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR = 0x6102, + CRYPTO_SUBSYS_MAX_HASH_INPUT_EXCEEDED = 0x6103, + CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM = 0x6104, + CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM = 0x6105, + CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM = 0x6106, + CRYPTO_SUBSYS_WRONG_SIGNATURE = 0x6107, + CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH = 0x6108, + CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE = 0x6109, + CRYPTO_SUBSYS_HASHING_ERROR = 0x610A, + CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS = 0x610B, + CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY = 0x610C, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS = 0x610D, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY = 0x610E, + + UFR_WRONG_PEM_CERT_FORMAT = 0x61C0, + + // X.509 specific statuses: + X509_CAN_NOT_OPEN_FILE = 0x6200, + X509_WRONG_DATA = 0x6201, + X509_WRONG_LENGTH = 0x6202, + X509_UNSUPPORTED_PUBLIC_KEY_TYPE = 0x6203, + X509_UNSUPPORTED_PUBLIC_KEY_SIZE = 0x6204, + X509_UNSUPPORTED_PUBLIC_KEY_EXPONENT = 0x6205, + X509_EXTENSION_NOT_FOUND = 0x6206, + X509_WRONG_SIGNATURE = 0x6207, + X509_UNKNOWN_PUBLIC_KEY_TYPE = 0x6208, + X509_WRONG_RSA_PUBLIC_KEY_FORMAT = 0x6209, + X509_WRONG_ECC_PUBLIC_KEY_FORMAT = 0x620A, + X509_SIGNATURE_NOT_MATCH_CA_PUBLIC_KEY = 0x620B, + X509_UNSUPPORTED_SIGNATURE_SCH = 0x620C, + X509_UNSUPPORTED_ECC_CURVE = 0x620D, + + // PKCS#7 specific statuses: + PKCS7_WRONG_DATA = 0x6241, + PKCS7_UNSUPPORTED_SIGNATURE_SCHEME = 0x6242, + PKCS7_SIG_SCH_NOT_MATCH_CERT_KEY_TYPE = 0x6243, + + PKCS7_WRONG_SIGNATURE = 0x6247, + + // MRTD specific statuses: + MRTD_SECURE_CHANNEL_SESSION_FAILED = 0x6280, + MRTD_WRONG_SOD_DATA = 0x6281, + MRTD_WRONG_SOD_LENGTH = 0x6282, + MRTD_UNKNOWN_DIGEST_ALGORITHM = 0x6283, + MRTD_WARNING_DOES_NOT_CONTAINS_DS_CERT = 0x6284, + MRTD_DATA_GROUOP_INDEX_NOT_EXIST = 0x6285, + MRTD_EF_COM_WRONG_DATA = 0x6286, + MRTD_EF_DG_WRONG_DATA = 0x6287, + MRTD_EF_DG1_WRONG_LDS_VERSION_LENGTH = 0x6288, + MRTD_VERIFY_CSCA_NOT_EXIST = 0x6289, + MRTD_VERIFY_WRONG_DS_SIGNATURE = 0x628A, + MRTD_VERIFY_WRONG_CSCA_SIGNATURE = 0x628B, + MRTD_MRZ_CHECK_ERROR = 0x628C, + + // ICAO Master List specific statuses: + ICAO_ML_WRONG_FORMAT = 0x6300, + ICAO_ML_CAN_NOT_OPEN_FILE = 0x6301, + ICAO_ML_CAN_NOT_READ_FILE = 0x6302, + ICAO_ML_CERTIFICATE_NOT_FOUND = 0x6303, + ICAO_ML_WRONG_SIGNATURE = 0x6307, + + // EMV specific statuses + SYS_ERR_OUT_OF_MEMORY = 0x7001, + EMV_ERR_WRONG_INPUT_DATA = 0x7002, + EMV_ERR_MAX_TAG_LEN_BYTES_EXCEEDED = 0x7004, + EMV_ERR_TAG_NOT_FOUND = 0x7005, + EMV_ERR_TAG_WRONG_SIZE = 0x7006, + EMV_ERR_TAG_WRONG_TYPE = 0x7007, + EMV_ERR_IN_CARD_READER = 0x7008, + EMV_ERR_READING_RECORD = 0x7009, + EMV_ERR_PDOL_IS_EMPTY = 0x7010, + EMV_ERR_LIST_FORMAT_NOT_FOUND = 0x7011, + EMV_ERR_AFL_NOT_FOUND = 0x7012, + EMV_ERR_AID_NOT_FOUND = 0x7013, + + // ISO7816-4 Errors (R-APDU) - 2 SW bytes returned by the card, prefixed with 0x000A: + UFR_APDU_SW_TAG = 0x000A0000, + UFR_APDU_SW_OPERATION_IS_FAILED = 0x000A6300, + UFR_APDU_SW_WRONG_PIN_4_TRIES_REMAINING = 0x000A63C4, + UFR_APDU_SW_WRONG_PIN_3_TRIES_REMAINING = 0x000A63C3, + UFR_APDU_SW_WRONG_PIN_2_TRIES_REMAINING = 0x000A63C2, + UFR_APDU_SW_WRONG_PIN_1_TRIES_REMAINING = 0x000A63C1, + UFR_APDU_SW_WRONG_PIN_0_TRIES_REMAINING = 0x000A63C0, + UFR_APDU_SW_WRONG_LENGTH = 0x000A6700, + UFR_APDU_SW_SECURITY_STATUS_NOT_SATISFIED = 0x000A6982, + UFR_APDU_SW_AUTHENTICATION_METHOD_BLOCKED = 0x000A6983, + UFR_APDU_SW_DATA_INVALID = 0x000A6984, + UFR_APDU_SW_CONDITIONS_NOT_SATISFIED = 0x000A6985, + UFR_APDU_SW_WRONG_DATA = 0x000A6A80, + UFR_APDU_SW_FILE_NOT_FOUND = 0x000A6A82, + UFR_APDU_SW_RECORD_NOT_FOUND = 0x000A6A83, + UFR_APDU_SW_DATA_NOT_FOUND = 0x000A6A88, + UFR_APDU_SW_ENTITY_ALREADY_EXISTS = 0x000A6A89, + UFR_APDU_SW_INS_NOT_SUPPORTED = 0x000A6D00, + UFR_APDU_SW_NO_PRECISE_DIAGNOSTIC = 0x000A6F00, + + MAX_UFR_STATUS = 0x7FFFFFFF, + + UFR_DISPLAY_IMAGE_LOAD_ERROR = 0x8001, + UFR_DISPLAY_IMAGE_DIMENSION_ERROR = 0x8002, + UFR_DISPLAY_IMAGE_UNSUPPORTED_CHANNELS = 0x8003, + UFR_DISPLAY_WRITE_CMD_ERROR = 0x8004, + UFR_DISPLAY_READ_ACK_ERROR = 0x8005, + UFR_DISPLAY_WRITE_CMDEXT_ERROR = 0x8006, + UFR_DISPLAY_READ_RESPONSE_ERROR = 0x8007, + UFR_DISPLAY_TEXT_COUNT_OVERFLOW = 0x8008, + UFR_DISPLAY_INDEX_OVERFLOW = 0x8009, + UFR_DISPLAY_WRONG_SIMBOL_NUMB = 0x8010, + UFR_DISPLAY_COMMAND_FAILED = 0x8011 + +} UFR_STATUS; + +typedef enum UFCODER_SESSION_CODES +{ + UFR_SESSION_UNKNOWN_ERROR = 0x00, + UFR_SESSION_CLOSED = 0x01, + UFR_SESSION_EXPIRED = 0x02, + UFR_SESSION_DEVICE_DISCONNECTED = 0x03, + UFR_SESSION_DEVICE_FAILED_TO_CONNECT = 0x04, + + // BLE specific error codes + UFR_BLE_SESSION_ERROR_INVALID_PARAMETERS = 0x11, + UFR_BLE_SESSION_ERROR_INVALID_HANDLE = 0x12, + UFR_BLE_SESSION_ERROR_NOT_CONNECTED = 0x13, + UFR_BLE_SESSION_ERROR_OUT_OF_SPACE = 0x14, + UFR_BLE_SESSION_ERROR_OPERATION_CANCELLED = 0x15, + UFR_BLE_SESSION_ERROR_CONNECTION_TIMEOUT = 0x16, + UFR_BLE_SESSION_ERROR_UUID_NOT_ALLOWED = 0x17, + UFR_BLE_SESSION_ERROR_ALREADY_ADVERTISING = 0x18, + UFR_BLE_SESSION_ERROR_CONNECTION_LIMIT_REACHED = 0x19, + UFR_BLE_SESSION_ERROR_UNKNOWN_DEVICE = 0x20, + UFR_BLE_SESSION_ERROR_OPERATION_NOT_SUPPORTED = 0x21, + UFR_BLE_SESSION_ERROR_PEER_REMOVED_PAIRING_INFORMATION = 0x22, + UFR_BLE_SESSION_ERROR_ENCRYPTION_TIMED_OUT = 0x23, + UFR_BLE_SESSION_ERROR_TOO_MANY_LE_PAIRED_DEVICES = 0x24, + + // NFC specific error codes + + // Sesssion errors + UFR_NFC_SESSION_ERROR_FIRST_NDEF_TAG_READ = 0x30, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TERMINATED_UNEXPECTEDLY = 0x31, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TIMEOUT = 0x32, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_SYSTEM_IS_BUSY = 0x33, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_USER_CANCELED = 0x34, + + // NDEF errors + UFR_NFC_SESSION_ERROR_TAG_NOT_WRITABLE = 0x40, + UFR_NFC_SESSION_ERROR_TAG_SIZE_TOO_SMALL = 0x41, + UFR_NFC_SESSION_ERROR_TAG_UPDATE_FAILURE = 0x42, + UFR_NFC_SESSION_ERROR_ZERO_LENGTH_MESSAGE = 0x43, + + // Transceive errors + UFR_NFC_SESSION_ERROR_RETRY_EXCEEDED = 0x50, + UFR_NFC_SESSION_ERROR_TAG_CONNECTION_LOST = 0x51, + UFR_NFC_SESSION_ERROR_TAG_NOT_CONNECTED = 0x52, + UFR_NFC_SESSION_ERROR_TAG_RESPONSE_ERROR = 0x53, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_SESSION_INVALIDATED = 0x54, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_PACKET_TOO_LONG = 0x55, + + UFR_NFC_SESSION_ERROR_TAG_COMMAND_CONFIGURATION_INVALID_PARAMETERS = 0x56, + + // Other + UFR_NFC_SESSION_ERROR_UNSUPPORTED_FEATURE = 0x61, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER = 0x62, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER_LENGTH = 0x63, + UFR_NFC_SESSION_ERROR_PARAMETER_OUT_OF_BOUNDS = 0x64, + UFR_NFC_SESSION_ERROR_RADIO_DISABLED = 0x65, + UFR_NFC_SESSION_ERROR_SECURITY_VIOLATION = 0x66, + +} UFR_SESSION_STATUS; + +// DESFIRE key settings values +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE 0x09 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE 0x0F +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x01 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x08 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x0E +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x00 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x06 + +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x00 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x01 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x02 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x03 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x04 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x05 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x06 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x08 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x09 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0A +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0B +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTH_AUTH 0x0C +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTH_AUTH 0x0D +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0E +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0F + +enum E_ASYMMETRIC_KEY_TYPES +{ + RSA_PRIVATE_KEY = 0, + ECDSA_PRIVATE_KEY, + + ASYMMETRIC_KEY_TYPES_NUM +}; + +#define MAX_ECC_CURVE_NAME_LEN 30 + +enum E_ECC_CURVE_DEFINITION_TYPES +{ + ECC_CURVE_INDEX, + ECC_CURVE_NAME, + ECC_CURVE_DOMAIN_PARAMETERS, + + ECC_CURVE_DEFINITION_TYPES_NUM +}; + +enum E_SIGNATURE_SCHEMES +{ + SHA1_WITH_RSA, + SHA256_WITH_RSA, + SHA384_WITH_RSA, + SHA512_WITH_RSA, + SHA224_WITH_RSA, + SHA512_224_WITH_RSA, + SHA512_256_WITH_RSA, + + RSA_PSS, + + ECDSA_WITH_SHA1, + ECDSA_WITH_SHA256, + ECDSA_WITH_SHA384, + ECDSA_WITH_SHA512, + ECDSA_WITH_SHA224, + + SIGNATURE_SCHEMES_NUM // Don't change the order. NEVER! +}; +enum E_SIGNATURE_SCH_TYPES +{ + RSA_PKCS1, + RSA_PKCS1_PSS, + ECDSA, + + SIGNATURE_SCH_TYPES_NUM +}; +enum E_PUB_KEY_TYPES +{ + PUB_KEY_TYPE_RSA, + PUB_KEY_TYPE_ECDSA_NAMED_CURVE, + PUB_KEY_TYPE_ECDSA_DOMAIN_PARAMS, + + PUB_KEY_TYPES_NUM +}; + +enum E_BIT_ENCODINGS +{ + ENCODING_BIN, + ENCODING_HEX +}; + +enum E_CERTIFICATE_TYPES +{ + X509_PEM, + X509_DER, + X509_GIDS_NFC, + + E_CERTIFICATE_TYPES_NUM +}; + +enum E_ECC_CURVES +{ + secp112r1, + secp112r2, + secp128r1, + secp128r2, + secp160r1, + secp160r2, + secp160k1, + secp192r1, + prime192v2, + prime192v3, + secp192k1, + secp224r1, + secp224k1, + secp256r1, + secp256k1, + secp384r1, + secp521r1, + prime239v1, + prime239v2, + prime239v3, + brainpoolP160r1, + brainpoolP192r1, + brainpoolP224r1, + brainpoolP256r1, + brainpoolP320r1, + brainpoolP384r1, + brainpoolP512r1, + brainpoolP160t1, + brainpoolP192t1, + brainpoolP224t1, + brainpoolP256t1, + brainpoolP320t1, + brainpoolP384t1, + brainpoolP512t1, + + ECC_CURVES_NUM + + /* Not supported in uFCoder library yet: + sect113r1, + sect113r2, + sect131r1, + sect131r2, + sect163k1, + sect163r1, + sect163r2, + sect193r1, + sect193r2, + sect233k1, + sect233r1, + sect239k1, + sect283k1, + sect283r1, + sect409k1, + sect409r1, + sect571k1, + sect571r1 + */ +}; +// #define F2M_CURVES sect113r1 + +typedef struct +{ + uint8_t *serial; + uint8_t *subject; + uint8_t *issuer; + uint8_t *SKI; + uint8_t *AKI; + uint32_t serial_len; + uint32_t subject_len; + uint32_t issuer_len; + uint32_t SKI_len; + uint32_t AKI_len; +} icaoMlSearchCriteria_t; + +typedef struct +{ + uint32_t ecc_curve_field_type; + void *field_domain_params; // To be defined. For now only a named primary field curves are supported. +} ecc_curve_domain_params_t; + +typedef struct +{ + uint32_t ecc_curve_definition_type; // one of the E_ECC_CURVE_DEFINITION_TYPES + uint32_t ecc_curve_index; + char *ecc_curve_name; + ecc_curve_domain_params_t *ecc_curve_domain_params; +} ecc_key_param_t; + +enum E_MRTD_IMG_TYPE +{ + MRTD_IMG_JPEG = 0, + MRTD_IMG_JP2 = 1, + MRTD_IMG_JPEG2000 = 1, // Alias for the MRTD_IMG_JP2 + + MRTD_IMG_TYPE_UNKNOWN = 0xFFFFFFFF +}; + +typedef enum +{ + USER_PIN = 0, + SO_PIN, + USER_PUK, + SO_PUK +} dl_sec_code_t; + +enum E_PRINT_VERBOSE_LEVELS +{ + PRINT_NONE, + PRINT_ESSENTIALS, + PRINT_DETAILS, + PRINT_ALL_PLUS_STATUSES, +}; + +// SAM definition +typedef enum E_SAM_HW_VER +{ + SAM_UNKNOWN_TYPE, + SAM_T1AD2060_AV1_MODE, + SAM_T1AD2060_AV2_MODE, + SAM_T1AR1070_AV1_MODE, + SAM_T1AR1070_AV2_MODE +} SAM_HW_TYPE; + +// Reader status +typedef enum E_EMULATION_MODES +{ + TAG_EMU_DISABLED, + TAG_EMU_DEDICATED, + TAG_EMU_COMBINED, + TAG_EMU_AUTO_AD_HOC +} emul_modes_t; + +typedef enum E_EMULATION_STATES +{ + EMULATION_NONE, + EMULATION_IDLE, + EMULATION_AUTO_COLL, + EMULATION_ACTIVE, + EMULATION_HALT, + EMULATION_POWER_OFF +} emul_states_t; + +typedef enum E_PCD_MGR_STATES +{ + PCD_MGR_NO_RF_GENERATED, + PCD_MGR_14443A_POLLING, + PCD_MGR_14443A_SELECTED, + PCD_MGR_CE_DEDICATED, + PCD_MGR_CE_COMBO_START, + PCD_MGR_CE_COMBO, + PCD_MGR_CE_COMBO_IN_FIELD +} pcd_states_t; + +enum E_RGB_PORT_NAMES +{ + EXTERNAL_RGB_PORT, + INTERNAL_RGB_PORT +}; + +enum E_CUSTOM_UI_IDLE_MODES +{ + CUSTOM_UI_IDLE_MODE_NONE = 0, + CUSTOM_UI_IDLE_MODE_STATIC_LED, + CUSTOM_UI_IDLE_MODE_BLINKING_LED, + CUSTOM_UI_IDLE_MODES_NUMBER_INDICATOR +}; + +enum E_CUSTOM_UI_DETECTED_MODES +{ + CUSTOM_UI_DETECTED_MODE_NONE = 0, + CUSTOM_UI_DETECTED_MODE_STATIC_LED, + CUSTOM_UI_DETECTED_MODE_STATIC_LED_BEEP, + CUSTOM_UI_DETECTED_MODE_BEEP, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED_BEEP, + CUSTOM_UI_DETECTED_MODES_NUMBER_INDICATOR +}; + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup INTERNAL !!!INTERNAL!!! uFR API calls (Not for public SDK use) (remove from final revision) + * @{ + */ + /** @} */ // end of defgroup INTERNAL + + /** + * @defgroup UNDOCUMENTED UNDOCUMENTED uFR API calls (remove from final revision) + * @brief Excluded from docs due to the nature of their usage + * @{ + */ + /**@}*/ // end of defgroup INTERNAL + + /** @defgroup LibLic Library licensing + * @brief Prerequisite API calls for facilitating use of uFR MDK (Mobile Development Kit) with Android/iOS devices (usage of mobile device internal NFC antenna) + * @{ + */ + /** @} */ // end of LibLic + + /** @defgroup SingleReader Single Reader + * @{ + */ + /** @defgroup ReaderAndLibrary Reader and library + ** @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication + + /** @defgroup ReaderAndLibrary_Information Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information + + /** @defgroup ReaderAndLibrary_EEPROM EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM + + /** @defgroup ReaderAndLibrary_Signalization Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization + + /** @defgroup ReaderAndLibrary_RGBSignalization RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL. + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl Display Control + * @since uFCoder library version 6.0.5 + * + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFROnlineCommands uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands + + /** @defgroup ReaderAndLibrary_BaseHDUFR uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR + + /** @defgroup ReaderAndLibrary_NXPSAM Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM + + /** @defgroup ReaderAndLibrary_HelperFunc Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc + + /**@}*/ // end of defgroup ReaderAndLibrary + + /** @defgroup Card_Tag Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockRead(), BlockWrite(), LinearRead(), LinearWrite() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF + + /** @defgroup Card_Tag_NTAG_2XX NTAG2XX (Type 2) specific commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG + + /** @defgroup Card_Tag_NT4H NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H + + /** @defgroup Card_Tag_Mifare_Desfire Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire + + /** @defgroup Card_Tag_Mifare_Desfire_Light Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Desfire_Light + + /** @defgroup Card_Tag_Mifare_Plus Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Plus + + /** @defgroup Card_Tag_Ultralight_C Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Ultralight_C + + /** @defgroup Card_Tag_JavaCardApplication Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication + + /** @defgroup Card_Tag_CardFeatures Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4 ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4 + + /** @defgroup Card_Tag_CardFeatures_ISO7816 ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816 + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification + + /** @defgroup Card_Tag_CardFeatures_MRTD Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD + + /** @defgroup Card_Tag_CardFeatures_TLS TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS + + /** @defgroup Card_Tag_CardFeatures_EMV Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV + + /** @defgroup Card_Tag_CardFeatures_AntiCollision Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode + + /**@}*/ // end of defgroup Card_Tag_CardFeatures + + /**@}*/ // end of defgroup Card_Tag + + /** @defgroup Miscellaneous Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous + + /**@}*/ // end of defgroup SingleReader + + /** @defgroup MultiReader MultiReader + * @{ + ** @defgroup ReaderAndLibrary_ReaderList Handling multiple readers + * @brief If you want to communicate and use multiple readers from an application, you have to follow the + * initial procedure for enumerating uFR compatible devices and getting their handles + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_ReaderList + + /** @defgroup ReaderAndLibrary_M Reader and library + * @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication_M Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication_M + + /** @defgroup ReaderAndLibrary_Information_M Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information_M + + /** @defgroup ReaderAndLibrary_EEPROM_M EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM_M + + /** @defgroup ReaderAndLibrary_Signalization_M Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization_M + + /** @defgroup ReaderAndLibrary_RGBSignalization_M RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_M Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFROnlineCommands_M uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands_M + + /** @defgroup ReaderAndLibrary_BaseHDUFR_M uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR_M + + /** @defgroup ReaderAndLibrary_NXPSAM_M Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM_M + + /** @defgroup ReaderAndLibrary_HelperFunc_M Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc_M + + /**@}*/ // end of defgroup ReaderAndLibrary_M + + /** @defgroup Card_Tag_M Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General_M General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare_M Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockReadM(), BlockWriteM(), LinearReadM(), LinearWriteM() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF_M NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF_M + + /** @defgroup Card_Tag_NTAG_2XX_M NTAG2XX (Type 2) related commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG_2XX_M + + /** @defgroup Card_Tag_NT4H_M NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H_M + + /** @defgroup Card_Tag_Mifare_Desfire_M Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_M + + /** @defgroup Card_Tag_Mifare_Desfire_Light_M Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_Light_M + + /** @defgroup Card_Tag_Mifare_Plus_M Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Plus_M + + /** @defgroup Card_Tag_Ultralight_C_M Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Ultralight_C_M + + /** @defgroup Card_Tag_JavaCardApplication_M Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common_M Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common_M + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage_M DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage_M + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_M + + /** @defgroup Card_Tag_CardFeatures_M Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking_M Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking_M + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4_M ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4_M + + /** @defgroup Card_Tag_CardFeatures_ISO7816_M ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816_M + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M + + /** @defgroup Card_Tag_CardFeatures_MRTD_M Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD_M + + /** @defgroup Card_Tag_CardFeatures_TLS_M TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS_M + + /** @defgroup Card_Tag_CardFeatures_EMV_M Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV_M + + /** @defgroup Card_Tag_CardFeatures_AntiCollision_M Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision_M + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode_M Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode_M + + /**@}*/ // end of defgroup Card_Tag_CardFeatures_M + + /**@}*/ // end of defgroup Card_Tag_M + + /** @defgroup Miscellaneous_M Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous_M + + /**@}*/ // end of defgroup MultiReader + + /** @defgroup uFR_MDK uFR MDK (Mobile Development Kit) + * @since uFCoder library version 6.0.0 + * + * Using the internal NFC antenna of a mobile device is supported in the uFCoder library through the usage of ReaderOpenEx() with appropriate parameters. + * It is mandatory to obtain a valid DLogic license to make use of the uFR MDK. + * License can be obtained automatically through the ReaderOpenEx() API call. + * Or using the GetLicenseRequestData() and our online service found at: https://liblic.d-logic.com/
+ * Refer to @ref LibLic group for details. + * + * @{ + */ + /** @defgroup uFR_MDK_Android Android + * @brief uFR MDK for Android currently has support for the NTAG2XX, Mifare Classic®, Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * @{ + */ + /** @defgroup uFR_MDK_Android_NTAG2XX NTAG2XX with NDEF support + * @brief Supported API calls for NTAG2XX (e.g NTAG203/210/213/215/216) cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * read_ndef_record() + * * write_ndef_record() + * * write_ndef_record_mirroring() + * * write_ndef_record_mirroring_tt() + * * get_ndef_record_count() + * * erase_last_ndef_record() + * * erase_all_ndef_records() + * * ndef_card_initialization() + * * WriteNdefRecord_WiFi() + * * WriteNdefRecord_BT() + * * WriteNdefRecord_SMS() + * * WriteNdefRecord_Bitcoin() + * * WriteNdefRecord_GeoLocation() + * * WriteNdefRecord_NaviDestination() + * * WriteNdefRecord_Email() + * * WriteNdefRecord_Address() + * * WriteNdefRecord_AndroidApp() + * * WriteNdefRecord_Text() + * * WriteNdefRecord_StreetView() + * * WriteNdefRecord_Skype() + * * WriteNdefRecord_Whatsapp() + * * WriteNdefRecord_Viber() + * * WriteNdefRecord_Contact() + * * WriteNdefRecord_Phone() + * * ReadNdefRecord_WiFi() + * * ReadNdefRecord_Bitcoin() + * * ReadNdefRecord_GeoLocation() + * * ReadNdefRecord_NaviDestination() + * * ReadNdefRecord_Email() + * * ReadNdefRecord_Address() + * * ReadNdefRecord_AndroidApp() + * * ReadNdefRecord_Text() + * * ReadNdefRecord_StreetView() + * * ReadNdefRecord_Skype() + * * ReadNdefRecord_Whatsapp() + * * ReadNdefRecord_Viber() + * * ReadNdefRecord_Contact() + * * ReadNdefRecord_Phone() + * * ReadNdefRecord_SMS() + * * ReadNdefRecord_BT() + * * ParseNdefMessage() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_NTAG2XX + + /** @defgroup uFR_MDK_Android_Mifare Mifare Classic + * @brief Supported API calls for Mifare Classic cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * SectorTrailerWrite_PK() + * * SectorTrailerWriteUnsafe_PK() + * * ValueBlockRead_PK() + * * ValueBlockWrite_PK() + * * ValueBlockInSectorRead_PK() + * * ValueBlockInSectorWrite_PK() + * * ValueBlockIncrement_PK() + * * ValueBlockDecrement_PK() + * * ValueBlockInSectorIncrement_PK() + * * ValueBlockInSectorDecrement_PK() + * * LinearFormatCard_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Mifare + + /** @defgroup uFR_MDK_Android_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth() + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth() + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Desfire + + /** @defgroup uFR_MDK_Android_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_Android + + /** @defgroup uFR_MDK_iOS iOS + * @brief uFR MDK for IOS currently has support only for Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * + * @{ + */ + /** @defgroup uFR_MDK_iOS_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_iOS_Desfire + + + /** @defgroup uFR_MDK_IOS_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_IOS_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_iOS + + /**@}*/ // end of defgroup uFR_MDK + + //-------------------------------------------------------------------------------------------------- + /** + * @brief Used to generate license request necessary for obtaing valid uFCoder license separately. + * + * Parameter "license_request" will hold a JSON string value that is to be used for our online front-end service for generating an offline license. + * The online service is found at: https://liblic.d-logic.com/ + * + * @ingroup LibLic + * + * @param months Number of months requested for the license + * @param license_request JSON string formed with licensing parameters + * + */ + void DL_API GetLicenseRequestData(uint32_t months, OUT char *license_request); + + /** + * @brief Used to validate and store an offline Dlogic license for future usage. + * + * @ingroup LibLic + * + * @param license_str JSON string containing full license data + * + * @return Operation status + */ + UFR_STATUS DL_API SetLicenseData(c_string license_str); + + /** + * @brief Opens reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s. If you have more than one µFR Online device, ReaderOpen function will open the first one found, for the device not connected to the PC via cable, use ReaderOpenEx() instead. + *
+ * NOTE: On Android, using ReaderOpen() will establish communication with uFR Series readers connected via OTG cable. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen(void); + + /** + * @brief Opens a port of connected reader using readers family type. Useful for speed up opening for non uFR basic reader type (e.g. BaseHD with uFR support). + * + * Do not use this function for opening communication with µFR Online devices. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenByType(uint32_t reader_type); + + enum E_READER_TYPE + { + AUTO = 0, + UFR_TYPE = 1, + UFR_RS232_TYPE = 2, + BASEHD_UFR_TYPE = 3, + UFR_ONLINE_TYPE = 4, + INTERNAL_NFC = 5 + }; + + /** + * @brief Open reader communication port in several different ways. Can be used for establishing communication with COM port too. + * + * There is enumeration in uFCoder.h file called E_READER_TYPE with values: + * enum E_READER_TYPE + * { + * AUTO = 0, + * UFR_TYPE = 1, + * UFR_RS232_TYPE = 2, + * BASEHD_UFR_TYPE = 3, + * UFR_ONLINE_TYPE = 4, + * INTERNAL_NFC = 5 + * }; + * Values in this enumeration you can pass into ReaderOpenEx function as reader_type parameter.
+ * For example, if you pass 4 as reader_type it will only work with µFR Online Series devices, and then as port_name you can pass devices IP address or serial number (ex: “192.168.1.123” or “ON101390”), for port_interface you can pass ‘U’ for UDP, ‘T’ for TCP or 0. + * If you pass 0, it will automatically search for reader working mode (UDP or TCP) and open it. For argument you can pass 0 or µFR Nano device serial number to open it on 1Mbit/s (ex: “UN123456”).
+ * Using value 5 as reader_type implies usage of internal mobile device NFC. + * Upon a call to ReaderOpenEx with this parameter, the library will try to obtain license automatically via HTTP. + * On success, a valid license is stored for future use. On failure, it moves to looking up for stored licenses. Results other than UFR_OK status imply a corresponding error that occurred and as such use of internal mobile device NFC will be unavailable. + * When using 5 as reader_type, additionally you can specify port_interface parameter to decide whether to do online->offline validation or just offline. To use offline-only validation of a previously stored valid DLogic license, set port_interface to 1. + * Value 0 is default value for port_interface and implies online->offline license validation. + * More examples for port open are given in the “Reader Open Examples” document: + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-doc/blob/master/Reader_Open_Examples.pdf + * Examples: + * ReaderOpenEx(1, “COM1”, 0, 0) + * This example will open communication with µFR device attached to COM1 port on 1Mbit/s + * ReaderOpenEx(1, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR device on 1Mbit/s + * ReaderOpenEx(2, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR RS232 device on 115200 bit/s + * ReaderOpenEx(4, “ON123456”, ‘U’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on UDP protocol. + * ReaderOpenEx(4, “ON123456”, ‘T’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘U’, 0) + * This example will open communication with µFR Online reader with IP address 192.168.1.123 on UDP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘T’, 0) + * This will open communication with µFR Online reader with IP address 192.168.1.123 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, 0, 0) + * It will open communication with µFR Online reader with IP address 192.168.1.123 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, 0) + * It will open communication with µFR Online reader with serial number ON123456 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with serial number ON123456 + * ReaderOpenEx(4, “192.168.1.123”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with IP address 192.168.1.123 + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) When uFR Online reader works in BT serial mode or transparent mode, reader_type must be set to 1. + * @param port_name is c-string type used to open port by given serial name. If you provide NULL or empty string that is AUTO MODE which calls ReaderOpenEx() and all available ports on the system. serial port name, identifier, like "COM3" on Windows or "/dev/ttyS0" on Linux or "/dev/tty.serial1" on OS X or if you select FTDI, reader serial number like "UN123456", if reader have integrated FTDI interface When the UDP interface type is selected, port_name must be provided in “address:port” format. Like "192.168.1.162:8881" IP for UDP I/F + * @param port_interface type of communication interfaces (define interface which we use while connecting to the printer), supported value's: 0 : auto - first try FTDI than serial if port_name is not defined 1 : try serial / virtual COM port / interfaces 2 : try only FTDI communication interfaces 10 : try to open Digital Logic Shields with RS232 uFReader on Raspberry Pi (serial interfaces with GPIO reset) 84 ('T') : TCP/IP interface 85 ('U') : UDP interface 102 ('B'): BT serial interface. Android library only. 114 ('L'): BLE interface. Android library only. When uFR Online reader works in BT serial mode, port_interface must be set to 0 (Except Android). arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * @param arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenEx(uint32_t reader_type, IN c_string port_name, uint32_t port_interface, IN void *arg); + + /** + * @brief Opens uFR Online device by serial number. + * + * Function will open communication (UDP or TCP) with device based on its working mode. If function cannot find given serial number, it will open communication on serial port with 1Mbit/s. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param serial_number Pointer to const char array (c_string) containing devices serial number (ex. “ON101390”). + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen_uFROnline(c_string serial_number); + + /** + * @brief Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderReset(void); + + /** + * @brief Physical reset of reader communication port & tests the communication before returning a UFR_STATUS code. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetWait(void); + + /** + * @brief Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderClose(void); + + /** + * @brief This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestart(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderHwReset(void); + + /** + * @brief Used to get the FTDI D2XX driver version number. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major: Byte value indicating driver version major number + * @param version_minor: Byte value indicating driver version minor number + * @param build: Byte value indicating driver version build number + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor, VAR uint8_t* build); + + /** + * @brief Used to get the FTDI D2XX driver version number as c-string. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_str: buffer that will contain driver version as c-string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersionStr(OUT char *version_str); + + /** + * @brief Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderType(VAR uint32_t *lpulReaderType); + + /** + * @brief Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumber(VAR uint32_t *lpulSerialNumber); + + /** + * @brief Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information + * + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnected(VAR uint32_t *connected); + + /** + * @brief Store a new key or change existing key under provided index parameter. + * + * The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWrite(IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLock(IN const uint8_t *password); + + /** + * @brief Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlock(IN const uint8_t *password); + + /** + * @brief This function turns sound and light reader signals. + * + * Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignal(uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). + * + * Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolume(uint8_t sound_volume); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserData(OUT uint8_t *aucData); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExt(OUT uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 byte array containing user data + * @return Operation status + */ + UFR_STATUS DL_API WriteUserData(IN const uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 byte array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExt(IN const uint8_t *aucData); + + /** + * @brief Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). + * + * We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @ingroup Card_Tag_General + * + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardId(VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * @ingroup Miscellaneous + * + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSak(VAR uint16_t *atqa, VAR uint8_t *sak); + + /** + * @brief Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKey(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKey(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKey(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKey(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKey(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesWritten, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * The method for proving authenticity is determined by the suffix in the functions names. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKey(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKey(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKey(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKey(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKey(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKey(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKey(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. + * + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Provided Key mode (PK) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PK(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PK(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PK(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PK(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PK(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PK(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PK(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PK(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PK(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PK(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PK(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTime(VAR uint8_t *time); + + /** + * @brief Function sets the date and time into the device's RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param password pointer to the 8 bytes array containing password time pointer to the 6 bytes array containing date and time representation + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief This function is used in Common, Advance and Access Control set of functions. + * + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM. Maximal length of array is 128 bytes. + * + * Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * @param password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeSector(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeBlock(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BusAdminCardMake(uint32_t serial, IN uint8_t *password); + + /** + * @brief Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information + * + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescription(OUT uint8_t pSerialDescription[8]); + + /** + * @brief Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information + * + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumber(VAR uint8_t *build); + + /** + * @brief This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs. + * + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi-card (anti collision) mode: + //------------------------------------------------------------------------------ + /** + * @brief This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollision(void); + + /** + * @brief Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollision(void); + + /** + * @brief If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. + * + * Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCards(VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + /** + * @brief For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. + * + * First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * Before calling this function you have to call EnumCards() first. + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCards(OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + /** + * @brief Selects one of the cards which UID is on the actual UID list of the enumerated cards. + * + * If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCard(IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. + * + * Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCard(void); + + /** + * @brief Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatus(VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + //------------------------------------------------------------------------------ + /** + * @brief This function returns card type according to DlogicCardType enumeration. + * + * For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General + * + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardType(VAR uint8_t *lpucCardType); + + /** + * @brief This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General + * + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturer(OUT char* card_manufacturer_str); + + /** + * @brief This function returns 8 bytes of the T2T version. + * + * All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersion(OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). + * + * The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General + * + * @param lpulLinearSize pointer to variable which contain size of user data space lpulRawSize pointer to variable which contain size of total data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSize(VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * @ingroup Miscellaneous + * + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatus(OUT uint8_t *tt_message, VAR uint8_t *tt_status); + //------------------------------------------------------------------------------ + /** + * @brief Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. + * + * The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @ingroup Card_Tag + * + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalData(OUT uint8_t data[32], VAR uint32_t *len); + + /** + * @brief Function returns reader’s serialized discovery loop structure. + * + * C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetup(OUT uint8_t *setupStruct, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoop(IN const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Function returns the AID set in the reader to retrieve the mobile phone's unique ID. + * + * If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAid(OUT uint8_t *aid, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAid(IN const uint8_t *aid, uint32_t len); + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfig(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtp(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlot(uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKey(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencrypted(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKey(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZone(uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZone(uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatus(VAR uint8_t *bool_config_zone_locked, VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevision(uint8_t revision[4]); + //------------------------------------------------------------------------------ + + // uFCoder PRO MODE + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProMode(VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProMode(const uint32_t ReaderProMode); + + // QR barcode crypt algorithm + // initialization. with TB serial like 'TB123456' + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_Initialize(IN const uint8_t *TBSerialString, uint16_t job_number); + + // You must define 25 bytes array in memory for out_card_data[] + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCard(const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + enum CARD_ENCRYPTION_CODE_TYPE + { + CODE_TYPE_STANDARD, + CODE_TYPE_GROUP, + CODE_TYPE_DAILY_RANGE, // valid from, but only to_timestamp / every day + }; + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNext(const uint32_t code_type, const uint32_t from_timestamp, const uint32_t to_timestamp, + const uint32_t additional_data_size, IN const uint8_t additional_data[], + VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSN(OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSN(VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSN(OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Function returns TNF, type of record, ID and payload from the NDEF record. + * + * NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_record(uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. + * + * Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, IN uint8_t *id, + IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, VAR uint8_t *card_formated); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_tt(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, + int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. + * + * Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_count(VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, OUT uint8_t *ndef_record_array, + VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_record(uint8_t message_nr); + + /** + * @brief Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_records(uint8_t message_nr); + + /** + * @brief Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. + * + * If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initialization(void); + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + /** + * @brief Function stores a message record for NTAG emulation mode into the reader. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdef(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief This function does the same as WriteEmulationNdef() function with the addition of an AAR embedded in to the NDEF message. + * + * AAR stands for “Android Application Record”. AAR is a special type of NDEF record that is used by Google’s Android operating system to signify to an NFC phone that an explicitly defined Android Application which should be used to handle an emulated NFC tag. Android App record will be added as the 2nd NDEF record in the NDEF message. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record type_record pointer to the array containing record type type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param type_record pointer to the array containing record type + * @param type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param id pointer to the array containing record ID + * @param id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param aar pointer to the array containing AAR record + * @param aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefWithAAR(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length, IN uint8_t *aar, uint8_t aar_length); + + /** + * @brief Put the reader permanently in a NDEF tag emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStart(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStop(void); + + /** + * @brief Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStart(void); + + /** + * @brief Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). + * + * uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStart(void); + + /** + * @brief Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStop(void); + + /** + * @brief This function returns current ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParams(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief This command set ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 CombinedModeEmulationStart Function description Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. Function declaration (C language) UFR_STATUS CombinedModeEmulationStart(void); Function takes no parameters. ________________ Support for ISO14443-4 protocol + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParams(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param is_field_present value representing whehter field is present (1) or not (0) + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldState(VAR uint8_t *is_field_present); + + /** + * @brief Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommMode(void); + + /** + * @brief The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommMode(void); + + /** + * @brief Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRam(IN uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data buffer containing ram data returned + * @param addr address from which to read reader RAM + * @param data_len length of data to read from RAM + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRam(OUT uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function stores a message record for NTAG emulation mode into the reader in the RAM. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRam(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, + IN uint8_t *id, uint8_t id_length, IN uint8_t *payload, uint32_t payload_length); + + /** + * @brief Put the reader permanently in a NDEF tag in RAM emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStopRam() function), or by reader reset. Use the function GetReaderStatus to check if the reader is still in emulation mode (maybe the reader was reset for some reason). + * From library version 5.0.31, and firmware version 5.0.31 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartRam(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopRam(void); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value sets to 0. + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value stays unchangeable. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterNonResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function disables the NFC counter in the card emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterDisabled(void); + + //------------------------------------------------------------------------------ + + // GetNfcT2TVersion() returns 8 bytes (see T2T documentation): + typedef struct t2t_version_struct + { + uint8_t header; + uint8_t vendor_id; + uint8_t product_type; + uint8_t product_subtype; + uint8_t major_product_version; + uint8_t minor_product_version; + uint8_t storage_size; + uint8_t protocol_type; + } t2t_version_t; + + // NfcT2TSafeConvertVersion() returns converts version_record that returned from GetNfcT2TVersion() + // or GetNfcT2TVersionM(). Conversion is "alignment safe" + // (you don't need to pay attention on structure byte alignment): + /** + * @brief This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion(). + * + * All modern T2T chips having same or very similar structure of the T2T version data represented in the uFR API by the structure type t2t_version_t: + * typedef struct t2t_version_struct { + * uint8_t header; + * uint8_t vendor_id; + * uint8_t product_type; + * uint8_t product_subtype; + * uint8_t major_product_version; + * uint8_t minor_product_version; + * uint8_t storage_size; + * uint8_t protocol_type; + * } t2t_version_t; + * This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). Conversion done by this function is "alignment safe". + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param version pointer to the structure of the t2t_version_t type which will receive converted T2T version + * @param version_record pointer to array containing 8 bytes of the raw T2T version acquired using function GetNfcT2TVersion() + * + */ + void DL_API NfcT2TSafeConvertVersion(t2t_version_t *version, const uint8_t *version_record); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignature(OUT uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], VAR uint8_t *lpucUidLen, + VAR uint8_t *lpucDlogicCardType); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExt(OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + /** + * @brief This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounter(uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounter(uint8_t counter_address, uint32_t inc_value); + + /** + * @brief This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. + * + * If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounter(VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK(VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK(VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfig(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigEx(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfig(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigEx(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only. Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode idle mode value + * @param card_detection_mode card detection mode value + * @param idle_color idle color value(RGB) + * @param card_detection_color card detection color value(RGB) + * @param enabled enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfig(uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only. Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode pointer to idle mode value + * @param card_detection_mode pointer to card detection mode value + * @param idle_color pointer to idle color value(RGB) + * @param card_detection_color pointer to card detection color value(RGB) + * @param enabled pointer to enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfig(uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_number(VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, uint8_t start_hour, + uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record(uint8_t record_number, VAR uint16_t *first_reader_nr, VAR uint16_t *last_reader_nr, + VAR uint8_t *start_hour, VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_record(uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_record(uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, uint8_t begin_hour, + uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, uint8_t end_hour, + uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_record(VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, VAR uint8_t *end_month, + VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_type(uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_type(VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_duration(uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_duration(VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_duration(uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_duration(VAR uint32_t *duration); + + // swimming pool ************************************************************** + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validity(VAR int32_t *credit, VAR uint32_t *begin_year, VAR uint32_t *begin_month, + VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, + VAR uint32_t *end_year, VAR uint32_t *end_month, VAR uint32_t *end_day, + VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validity(int32_t credit, uint32_t begin_year, uint32_t begin_month, uint32_t begin_day, + uint32_t begin_hour, + uint32_t begin_minute, + uint32_t end_year, uint32_t end_month, uint32_t end_day, uint32_t end_hour, + uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_record(uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_record(uint8_t record_number, VAR uint8_t *right_record_type, OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counter(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, + uint8_t end_minute, IN uint8_t *days, uint8_t max_daily_counter); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record_type_max_daily_counter(uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, + VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days, VAR uint8_t *max_daily_counter); + + //============================================================================= + + /** + * @brief Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOn(uint16_t pulse_duration); + + /** + * @brief Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayState(uint8_t state); + + /** + * @brief Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param intercom shows that there is voltage at the terminals for intercom connection, or notss + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoState(VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControl(uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Function gets the state of the input pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param input_nr ordinal number of hardware specific input pin input_state input state 1 or 0. + * @param input_state input state 1 or 0. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetInputState(uint8_t input_nr, VAR uint8_t *input_state); + + /** + * @brief This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControl(uint8_t light_status); + + /** + * @brief For classic uFR PLUS devices only. The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. + * + * This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControl(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Sets the color of the RGB diodes. + * + * This color stays on the RGB diodes until the function GreenLedBlinkingTurnOn() is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity(). + * Before this function call, the function GreenLedBlinkingTurnOff() must be called, or the reader is already in mode of blocking automatic signalization. + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControl(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControl(uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes. + * + * This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleep(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. + * + * In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. + * Function also sets the number of omitted activity periods, when the RGB light is off. + * For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriod(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSet(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefault(void); + + /** + * @brief The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. + * + * Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMax(uint8_t bad_select_nr_max); + + /** + * @brief The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMax(VAR uint8_t *bad_select_nr_max); + + /** + * @brief Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepMode(void); + + /** + * @brief Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepMode(void); + + /** + * @brief Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSet(uint8_t seconds_wait); + + /** + * @brief Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGet(VAR uint8_t *seconds_wait); + + /** + * @brief This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanently(unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParameters(VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. + * + * Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. + * The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. + * For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayData(IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Function has the same functionality as the function SetDisplayData(). New feature is the RGB port selection. + * + * Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbData(IN uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequency(uint16_t frequency); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * SetRgbIntensity()(alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * GetRgbIntensity (alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensity(VAR uint8_t *intensity); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRgbIntensity(VAR uint8_t *intensity); + // DESFIRE functions ************************************************************** + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode(void); + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATS(OUT uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorage(void); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceive(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint32_t *ufr_status); + + /** + * @brief Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Transceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, uint8_t data_out_len, + OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, uint8_t send_le, + OUT uint8_t *apdu_status); + + /** + * @brief Sends C–APDU in the c_string (zero terminated) format, containing pairs of the hexadecimal digits. + * + * Pairs of the hexadecimal digits can be delimited by any of the punctuation characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu C-APDU hexadecimal c_string + * @param r_apdu Received R-APDU as a hexadecimal c_string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceive(IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are sent and receive in the form of the byte arrays. + * + * There is obvious need for a c_apdu_len and *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceive(IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @param c_apdu array containing C_APDU + * @param c_apdu_len length of C_APDU + * @param r_apdu buffer that will store R_APDU + * @param r_apdu_len returns length of R_APDU + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeap(IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief This is “exploded binary” alternative function intended for support APDU commands in ISO 14443-4A tags. + * APDUTransceive() receives separated parameters which are an integral part of the C– APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls cls + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, uint32_t Nc, + OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chain(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint8_t *rcv_chained, + VAR uint32_t *ufr_status); + + /** + * @brief R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceive(uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselect(uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * @ingroup UNDOCUMENTED + * + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive(uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, uint8_t crypto1, + uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Function sets the parameters for transceive mode. + * + * If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_start(uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stop(void); + + /** + * @brief Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enable(void); + + /** + * @brief The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending rcv_data pointer to data array received from card bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceive(IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, uint32_t bytes_to_receive, + VAR uint32_t *rcv_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interface(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_Generic(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interface(void); + + /** + * @brief Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDU(void); + + /** + * @brief Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4(void); + + /** + * @brief Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interface(void); + + /** + * @brief APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interface(void); + + //============================================================================== + /** + * @brief Using this function you can select the appropriate application on the card. + * + * For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAid(IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief In JCApp cards you can put two types of asymmetric crypto keys. + * + * Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKey(uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + IN const uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPair(uint8_t key_type, uint8_t key_index, uint8_t key_designator, uint16_t key_bit_len, + IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPair(uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPair(uint8_t key_index); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBegin(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *chunk, + uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdate(IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEnd(VAR uint16_t *sig_len); + + /** + * @brief This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignature(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *plain_data, + uint16_t plain_data_len, VAR uint16_t *sig_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Finally, to get a signature, you have to call JCAppGetSignature(). + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior calling of this function you have to be logged in with an User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig Pointer to an array of “sig_len” bytes length. Value of the “sig_len” you've got as a parameter of the JCAppSignatureEnd() or JCAppGenerateSignature() functions. You have to allocate those bytes before calling this function. + * @param sig_len Length of the allocated bytes in a sig array. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetSignature(OUT uint8_t *sig, uint16_t sig_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObj(uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, uint8_t id_size); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubject(uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Using this function you can delete certificate objects from a card. + * + * This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCert(uint8_t obj_type, uint8_t obj_index); + + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjId(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubject(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObj(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + /** + * + * @ingroup Card_Tag_JavaCardApplication + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + c_string DL_API JCAppGetErrorDescription(UFR_STATUS apdu_error_status); + + /** + * @brief This function is used to login to the JCApp with an appropriate PIN code. + * + * Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. JCAppGetPinTriesRemaining Function description This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. This function have parameter of the type dl_sec_code_t which is defined as: typedef enum { USER_PIN = 0, SO_PIN, USER_PUK, SO_PUK } dl_sec_code_t; + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLogin(uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemaining(dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t. + * + * Which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code. + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChange(dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief This function is used to unblock PIN code which is specified by the SO parameter. + * + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblock(uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKey(uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, OUT uint8_t *exponent, + VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKey( + uint8_t key_index, OUT uint8_t *keyW, + VAR uint16_t *keyWSize, + OUT uint8_t *field, VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, VAR uint16_t *g_size, + OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBits(uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + //------------------------------------------------------------------------------ + /** + * @brief This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. + * + * Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list_size ointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSize(VAR uint32_t *list_size); + + /** + * @brief After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFiles(OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief This function returns file size indexed by the parameter card_file_index, on successful execution. + * + * Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file which size we want to get. + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSize(uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFile(uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief This function reads a file from the DLStorage card directly to the new file on the host file-system. + * + * If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. + * + * Parameter data_size defines the amount of data to be written in the file on the DLStorage card. + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFile(uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief This function writes file content from the host file-system to the new file on the DLStorage card. + * + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief After successful call to this function, the file on the DLStorage card will be deleted. + * + * Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFile(uint8_t file_index); + //------------------------------------------------------------------------------ + /** + * @brief This function is used to get hash output length in bytes for specified hash algorithms. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator for which we want to get output length in bytes. Use values declared in E_HASH_ALGS enumeration. + * @param out_byte_len After successful function execution, the variable on which this pointer points to, will contain output hash length in bytes for specified hash algorithm. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashOutputByteLength(uint32_t hash_algo, VAR uint32_t *out_byte_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions) + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHash(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, OUT uint8_t *hash, uint32_t hash_alocated); + + /** + * @brief This function calculates and returns the hash of the data in the buffer pointed by the “in” function parameter. + * + * Hash algorithm is specified by the hash_algo function parameter. + * If output bytes don't match with hash_alocated function parameter function returns CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH status. + * GetHashToHeap() automatically allocates memory, which *hash parameter will point to after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used for calculation. Use values declared in E_HASH_ALGS enumeration. + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions). + * @param hash After successful function execution, the variable on which this pointer points to, will contain the pointer to the output hash. + * @param hash_len After successful function execution, the variable on which this pointer points to, will contain output hash length. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashToHeap(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, VAR uint8_t **hash, VAR uint32_t *hash_len); + + /** + * @brief This function is used in conjunction with DLHashUpdateChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() has to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used in the following hashing sequence. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashInitChunked(uint32_t hash_algo); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param in One of the chunks of data of which hash is calculated. + * @param in_len Chunk length in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashUpdateChunked(IN const uint8_t *in, uint32_t in_len); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunked(OUT uint8_t *hash, uint32_t hash_alocated); + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * DLHashFinishChunkedToHeap() automatically allocates memory, which *hash parameter will point to, after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunkedToHeap(OUT uint8_t **hash, VAR uint32_t *hash_alocated); + + /** + * @brief This function is used to verify the digital signature of the pre-hashed value or some relatively short plain text message. + * + * If there is no errors during the verification process and digital signature correspond to the "To Be Signed" (TBS) data array and public cryptographic key, the function returns UFR_OK status. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * In case of wrong digital signature, function returns CRYPTO_SUBSYS_WRONG_SIGNATURE status. + * Function can return following status codes in case of various errors: + * * CRYPTO_SUBSYS_NOT_INITIALIZED + * * CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS + * * CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS + * * CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE + * * CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR + * For digest_alg use one of the values declared in E_SIGNER_DIGESTS enumeration: + * enum E_SIGNER_DIGESTS { + * ALG_NULL = 0, + * ALG_SHA, + * ALG_SHA_256, + * ALG_SHA_384, + * ALG_SHA_512, + * ALG_SHA_224, + * ALG_SHA_512_224, + * ALG_SHA_512_256, + * SIG_DIGEST_MAX_SUPPORTED + * }; + * ALG_SHA is the designator for the SHA-1 algorithm. + * For padding_alg use one of the values declared in E_SIGNER_RSA_PADDINGS enumeration: + * enum E_SIGNER_RSA_PADDINGS { + * PAD_NULL = 0, + * PAD_PKCS1_V1_5, + * PAD_PKCS1_PSS, + * SIG_PAD_MAX_SUPPORTED + * }; + * PAD_PKCS1 is an alias of the PAD_PKCS1_V1_5 padding algorithm: + * #define PAD_PKCS1 PAD_PKCS1_V1_5 + * For cipher_alg use one of the values declared in E_SIGNER_CIPHERS enumeration: + * enum E_SIGNER_CIPHERS { + * SIG_CIPHER_RSA = 0, + * SIG_CIPHER_ECDSA, + * SIG_CIPHER_MAX_SUPPORTED + * }; + * When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * + * @ingroup Card_Tag_CardFeatures_DigitalSignatureVerification + * + * @param digest_alg in the E_SIGNER_DIGESTS enumeration. + * @param padding_alg in the E_SIGNER_RSA_PADDINGS enumeration. When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * @param cypher_alg in the E_SIGNER_CIPHERS enumeration. tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * @param tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param signature Pointer to the signature array. + * @param signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. + * @param sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). + * @param pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. + * @param pub_key_params_len Length of the additional public key parameters (in bytes). + * + * @return Operation status + */ + UFR_STATUS DL_API DigitalSignatureVerifyHash(uint32_t digest_alg, uint32_t padding_alg, uint32_t cypher_alg, IN const uint8_t *tbs, + uint32_t tbs_len, IN const uint8_t *signature, uint32_t signature_len, + IN const void *sig_params, uint32_t sig_params_len, IN const uint8_t *pub_key, + uint32_t pub_key_len, IN const void *pub_key_params, uint32_t pub_key_params_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetHashName(uint32_t hash_algo); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the ECC curve designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param eccCurve ECC curve designator. Use values declared in E_ECC_CURVES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetEccCurveName(uint32_t eccCurve); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the signature scheme (signature algorithm) designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param signatureScheme Signature scheme (signature algorithm) designator. Use values declared in E_SIGNATURE_SCHEMES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetSignatureSchemeName(uint32_t signatureScheme); + + /** + * @brief Release the memory allocated from some of the library functions previously called making it available again for further allocations. + * + * Use to deallocate i.e. cleanup memory on the heap allocated. This function is a so-called helper for programming languages other than C/C++ where you can use a free(ptr) instead. Use only after calling the library functions for which it is explicitly indicated in this manual. Function returns nothing. After successful function execution ptr will point to NULL. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param ptr Pointer to the memory allocated on the heap which you want to release. If ptr does not point to a block of memory allocated with the library functions, it causes undefined behavior. If ptr is NULL, the function does nothing. Digital signature verification Enumerations, types and structures for use with DigitalSignatureVerifyHash function enum E_ECC_CURVE_DEFINITION_TYPES { ECC_CURVE_INDEX, ECC_CURVE_NAME, ECC_CURVE_DOMAIN_PARAMETERS, ECC_CURVE_DEFINITION_TYPES_NUM }; + * + */ + void DL_API DLFree(void *ptr); + //------------------------------------------------------------------------------ + /** + * @brief Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBac(IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], + VAR uint64_t *send_sequence_cnt); + + /** + * @brief Use this function to read files from the eMRTD NFC tag. + * + * You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param file_index Parameter that specifies the file we want to read from the eMRTD. This is a pointer to byte array containing exactly two bytes designating eMRTD file. Those two bytes are file identificator (FID) and there is a list of FIDs: EF.COM = {0x01, 0x1E} EF.DG1 = {0x01, 0x01} EF.DG2 = {0x01, 0x02} EF.DG3 = {0x01, 0x03} EF.DG4 = {0x01, 0x04} EF.DG5 = {0x01, 0x05} EF.DG6 = {0x01, 0x06} EF.DG7 = {0x01, 0x07} EF.DG8 = {0x01, 0x08} EF.DG9 = {0x01, 0x09} EF.DG10 = {0x01, 0x0A} EF.DG11 = {0x01, 0x0B} EF.DG12 = {0x01, 0x0C} EF.DG13 = {0x01, 0x0D} EF.DG14 = {0x01, 0x0E} EF.DG15 = {0x01, 0x0F} EF.DG16 = {0x01, 0x10} EF.SOD = {0x01, 0x1D} + * @param output After the successful call to this function, this pointer will point to the pointer on the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated during function execution. Maximum amount of data allocated can be 32KB. There is a programmer responsibility to cleanup allocated data (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * @param output_length After the successful call to this function, this pointer is pointed to the size of the file data read from an eMRTD file specified by the file_index parameter. + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeap(IN const uint8_t file_index[2], VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief This function validates data groups read from the eMRTDocument. + * + * All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function.\ + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidate(IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, uint32_t verbose_level, + OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, you can call this function and pass it null terminated strings containing document number, document holder date of birth and document expiration date. + * + * After successful function execution MRZ Proto Key will be stored in a mrz_proto_key 25-byte array. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param doc_number Pointer to a null terminated string containing exactly 9 characters document number. + * @param date_of_birth Pointer to a null terminated string containing exactly 6 characters representing the date of birth in the “YYMMDD” format. + * @param date_of_expiry Pointer to a null terminated string containing exactly 6 characters representing expiration date in the “YYMMDD” format. + * @param mrz_proto_key This byte array will contain a calculated MRZ proto-key after successful function execution. This array must have allocated at least 25 bytes prior to calling this function. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTD_MRZDataToMRZProtoKey(IN const char *doc_number, IN const char *date_of_birth, IN const char *date_of_expiry, + OUT uint8_t mrz_proto_key[25]); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, in the case of the TD3 MRZ format (88 totally character long), you can call this function and pass it a null terminated string containing the MRZ subjacent row. + * + * Example of the TD3 MRZ format printed on the eMRTD document looks like this: + * P File 2, and overwrites the contents with data provided + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param data Array containing NDEF message data stored in a buffer to be written + * @param data_length length of the data to be written + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFMessage(IN uint8_t *data, uint32_t data_length); + + /** + * @brief Function used to read the whole NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param message pointer to array that will hold message data + * @param message_length length of the message that was read if successfull + * + * @return Operation status + */ + + UFR_STATUS DL_API uFR_int_DesfireReadNDEFMessage(OUT uint8_t* message, uint32_t *message_length); + /** + * @brief Function used to extract the payload of the NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param payload_str pointer to buffer that will hold payload data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadNDEFPayload(OUT char* payload_str); + + /** + * @brief Function used to write the payload of the NDEF message on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * The function takes in only c-string URI, and sets it's uri_identifier to 0 so it is not prefixed by anything when read. + * + * @param payload_str pointer to buffer that will hold message data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFPayload(IN c_string payload_str); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief The function allows the blinking of the green diode independently of the user's signaling command (default setting). + * + * This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOn(void); + + /** + * @brief The function prohibits the blinking of the green diode independently of the user's signaling command. + * + * LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOff(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOn(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOff(void); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeA(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeB(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212Default(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424Default(void); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeA(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeB(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t CWGsNOff, + uint8_t ModGsNOff); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API FastFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParameters(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrate(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersPN7462(OUT uint8_t *die_id, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, VAR uint8_t *fw_ver_build); + + // SAM + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_raw(OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version(VAR SAM_HW_TYPE *sam_type, OUT uint8_t *sam_uid); + + /** + * @brief Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_raw(uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param key_no key_no + * @param key_v key_v + * @param des_key des_key + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_des(uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * @ingroup UNDOCUMENTED + * + * @param aes_key_ver_a aes_key_ver_a + * @param ver_a ver_a + * @param aes_key_ver_b aes_key_ver_b + * @param ver_b ver_b + * @param aes_key_ver_c aes_key_ver_c + * @param ver_c ver_c + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_key(IN uint8_t *aes_key_ver_a, uint8_t ver_a, IN uint8_t *aes_key_ver_b, + uint8_t ver_b, IN uint8_t *aes_key_ver_c, uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param master_aes_key master_aes_key + * @param key_version key_version + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_mode(IN uint8_t *master_aes_key, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. + * + * A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plain(IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *keyA, IN uint8_t *keyB, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Ultralight C card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 8 bytes of DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_key(uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + uint8_t sam_lock_unlock, uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKey(uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeable(void); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfReset(void); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOn(void); + + /** + * @brief Function switch off RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderId(IN uint8_t *reader_id); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReader(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderUsb(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderStreamUsb(IN uint8_t *data, uint16_t packet_nr); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BootReader(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_CodeProtect(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParams(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParamsUsb(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_Test(uint8_t param); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdCalibration(uint8_t lpcd_threshold, OUT uint16_t *lpcd_reference); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdPerform(uint8_t lpcd_threshold, uint16_t lpcd_reference, VAR uint16_t *lpcd_agc, VAR uint8_t *lpcd_status); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOn(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ExtField(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ESP32_boot_init(IN uint8_t *reader_cnt, uint8_t reader_nr); + + // MIFARE PLUS + /** + * @brief Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePerso(uint16_t address, IN uint8_t *data); + + /** + * @brief Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPerso(void); + + /** + * @brief Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param card_master_key card_master_key + * @param card_config_key card_config_key + * @param level_2_switch_key level_2_switch_key + * @param level_3_switch_key level_3_switch_key + * @param level_1_auth_key level_1_auth_key + * @param select_vc_key select_vc_key + * @param prox_chk_key prox_chk_key + * @param vc_poll_enc_key vc_poll_enc_key + * @param vc_poll_mac_key vc_poll_mac_key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimal(IN uint8_t *card_master_key, IN uint8_t *card_config_key, IN uint8_t *level_2_switch_key, + IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, IN uint8_t *select_vc_key, + IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key); + + /** + * @brief Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current master key *new key pointer to 16 byte array containing the new master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new master key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new configuration key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) *configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PK(IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKey(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Key B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key_index new_key_index + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index, uint8_t new_key_type); + + /** + * @brief + * ADD DESCRIPTION + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param old_key old_key + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * @brief Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKey(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PK(IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key_index pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief + * Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PK(IN uint8_t *key); + + /** + * @brief No authentication. Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_auth(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_key(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key(IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + /** + * @brief No authentication. Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_auth_internal(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_key_internal(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_internal(IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceGet(uint32_t auth_mode, IN void *auth_value, VAR int32_t *credit); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceSet(uint32_t auth_mode, IN void *auth_value, int32_t credit); + + /** + * @brief This function sets communication speed (UART baud rate). + * + * Allowed values of baud rate are: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, and 1000000 bps. All RS232 devices are supported, and USB devices (Nano FR, Classic) from firmware version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param baud_rate UART baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API SetUartSpeed(uint32_t baud_rate); + + /** + * @brief This function returns communication speed (UART baud rate) to default value. + * + * For RS23 devices default communication speed is 115200 bps, and for USB devices is 1000000 bps. + * For RS232 devices from version 5.0.1 (plus devices), and for USB devices from version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 1 - USB 2 - RS232 + * @param comm_type 1 - COM port 2 - FTDI + * @param port_name If comm_type is FTDI enter empty string If comm_type is COM port Windows “COMx” Linux “/dev/ttyUSBx” Mac OS “/dev/tty.usbserial-xxxxxxxx” + * + * @return Operation status + */ + UFR_STATUS DL_API SetDefaultUartSpeed(uint8_t reader_type, uint8_t comm_type, IN c_string port_name); + + // NT4H + /** + * @brief Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. + * + * This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parameters(uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Provided Key mode (PK) The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit read_ctr_limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Provided Key mode (PK) Function enables card Random ID. + * + * Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pk(IN uint8_t *aes_key_ext); + UFR_STATUS DL_API nt4h_unset_rid_pk(IN uint8_t *aes_key_ext); + + /** + * @brief Function enables card Random ID. Authentication with application master key (key number 0) required. + * + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid(uint8_t aes_key_no); + + /** + * @brief Provided Key mode (PK) Function returns card UID if Random ID activated. + * + * Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid(uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Provided Key mode (PK) Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pk(IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key(uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Provided Key mode (PK) Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pk(IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr(uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief No authentication. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_auth(uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Helper function for the MAC of SDM checking. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param mac_in_data data from mac_input_offset to mac_offset + * @param mac_in_len mac_input_offset - mac_offset + * @param sdm_mac pointer to array contained 8 bytes SDM MAC + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_check_sdm_mac(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *mac_in_data, IN uint8_t mac_in_len, IN uint8_t *sdm_mac); + + /** + * @brief Helper function for decryption of encrypted file data. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param enc_file_data pointer to array contained encrypted part of file data + * @param enc_file_data_len length of encrypted part of file data + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_sdm_enc_file_data(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *enc_file_data, IN uint8_t enc_file_data_len); + + /** + * @brief Helper function for decryption of encrypted PICC data. + * + * Function returns UID and SDM reading counter. Users need to know the AES key for metadata read (PICC data). + * + * @ingroup Card_Tag_NT4H + * + * @param picc_data pointer to array contained encrypted PICC data + * @param auth_key pointer to array contained AES meta data read key + * @param picc_data_tag if bit 7 set exist UID mirroring if bit 6 set exist SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param smd_read_cnt pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_picc_data(IN uint8_t *picc_data, IN uint8_t *auth_key, IN uint8_t *picc_data_tag, IN uint8_t *uid, IN uint32_t *smd_read_cnt); + + /** + * Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature(uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pk(IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status(uint8_t aes_key_no, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_auth(VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pk(IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt(uint8_t aes_key_no, uint8_t tt_status_key_no); + + // Desfire light + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param file_type file type 0 - standard data file, 2 - value file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param free_get_value value file get value without authentication (0 - disabled, 1 - enabled) + * @param record_size cyclic record file size of record + * @param max_number_of_rec cyclic record file maximal number of record + * @param curr_number_of_rec cyclic record file number of used record + * @param ex_unauth_operation TMC file exclude unauthorized operation + * @param tmc_limit_conf TMC file limit configuration + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param tmc_limit TMC file counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, VAR uint8_t *free_get_value, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *ex_unauth_operation, VAR uint8_t *tmc_limit_conf, VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, VAR uint32_t *tmc_limit); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered read_key_no read key number (0 - 4) write_key_no write key number (0 - 4) read_write_key_no read write key number (0 - 4) change_key_no change key number (0 - 4) + * @param key_no DESCRIPTION + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no currnent change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Function changes file settings of the Transaction MAC file. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no aes_key_no + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * @ingroup UNDOCUMENTED + * + * @param aes_key_ext aes_key_ext + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * @brief + * From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pk(IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file(uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in credit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of credit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_credit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in debit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of debit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_debit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in clear record operation. Function also returns decrypted Previous Reader ID. Users must enter file number, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_clear_record_transaction_mac(uint8_t file_no, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + // reader + /** + * @brief Function returns various reader states. + * + * From library version 5.0.31 and firmware version 5.0.33 + * The reader states are defined into following structures. This function is useful for checking if the reader is still in emulation mode after calling the TagEmulationStartRam() function. + * typedef enum E_EMULATION_MODES { + * TAG_EMU_DISABLED, + * TAG_EMU_DEDICATED, + * TAG_EMU_COMBINED, + * TAG_EMU_AUTO_AD_HOC + * }emul_modes_t; + * typedef enum E_EMULATION_STATES + * { + * EMULATION_NONE, + * EMULATION_IDLE, + * EMULATION_AUTO_COLL, + * EMULATION_ACTIVE, + * EMULATION_HALT, + * EMULATION_POWER_OFF + * }emul_states_t; + * typedef enum E_PCD_MGR_STATES + * { + * PCD_MGR_NO_RF_GENERATED, + * PCD_MGR_14443A_POLLING, + * PCD_MGR_14443A_SELECTED, + * PCD_MGR_CE_DEDICATED, + * PCD_MGR_CE_COMBO_START, + * PCD_MGR_CE_COMBO, + * PCD_MGR_CE_COMBO_IN_FIELD + * }pcd_states_t; + * + * @ingroup Miscellaneous + * + * @param state - normal working mode states are PCD_MGR_NO_RF_GENERATED or PCD_MGR_14443A_POLLING or PCD_MGR_14443A_SELECTED. - NTAG emulation mode state is PCD_MGR_CE_DEDICATED emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderStatus(VAR pcd_states_t *state, VAR emul_modes_t *emul_mode, VAR emul_states_t *emul_state, VAR uint8_t *sleep_mode); + + // EMV FUNCTIONS + + /** + * @brief Used for extracting the credit card PAN number. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param pan_str Pointer to char array containing credit card PAN. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetPAN(IN c_string df_name, OUT char *pan_str); + + /** + * @brief Used for extracting details about the last transaction stored in a credit card. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param last_transaction_info Pointer to char array containing details about the last transaction stored in the card. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetLastTransaction(IN c_string df_name, OUT char *last_transaction_info); + + + /** + * @brief Function is used for extracting image pixel values and storing them in the display for later use. This function will not render the image to the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param gallery_index - where in displays memory to store the bitmap(0-10) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveBitmapToGallery(const char* filename, int gallery_index); + + /** + * @brief Function takes an image and extracts it's pixel values and then just renders the on the display without storing the bitmap in the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param timeout - how long the bitmap should stay on display, 0-is indefinitely + * @param positionX - where on the display to start the bitmap. + * @param positionY - where on the display to start the bitmap. + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmap(const char* filename, uint32_t timeout, int positionX, int positionY); + + /** + * @brief Function renders an image that is stored in the display gallery. The gallery consist of 15 slots, of those 15 - 10 are used for storing bitmaps and the other 4 (11-15) are SystemBitmaps used by the display. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param gallery_index - which slot from the gallery to render on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmapFromGallery(int gallery_index); + + /** + * @brief Function allows you to change the essential symbols that the display regularly uses. These symbols include the Boot Image (ID-15), the Check bitmap(ID-14), and the Cross bitmap (ID-13). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param system_bitmap_index - ID of which system bitmap to change or import new (if slot is free 11-12) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveSystemBitmap(const char* filename, int system_bitmap_index); + + /** + * @brief Function renders the last image that was called with the function Display_ShowBitmap() + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowLastUnsavedImage(); + + /** + * @brief Function is used for communicating with the uFR device via I2C in COM protocol format. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param cmd - Command packet (read the "COM protocol" for more information) + * @param cmd_ext - Command extended packet, if cmd_ext is not being sent then should be "NULL" + * @param rsp - Array where the response will be written (at least 7 bytes) + * @return Operation status + */ + UFR_STATUS DL_API Display_Transmit(uint8_t *cmd, uint8_t *cmd_ext, uint8_t *rsp); + + /** + * @brief Function displays custom text on the screen. It can also enable text scrolling, position the text at a specific location on the display, and adjust the font size and style + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param customText - pointer to a string text + * @param fontStyle - number to change font style (0-1; 0 - default; 1 - not implemented) + * @param fontSize - number to change font size (0-1; 0 - 8x8 pixels; 1 - 16x16 pixels) + * @param scrollEnable - number to enable scroll (0-1) + * @param positionX - number containing X cordinate to place the text + * @param positionY - number containing Y cordinate to place the text + * @return Operation status + */ + UFR_STATUS DL_API Display_PrintText(const char* customText, int fontStyle, int fontSize, int scrollEnable, int positionX, int positionY); + + /** + * @brief Function displays a chec or a cross bitmap and, if a speaker is connected to the display, it triggers a function that produces a beep sound + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param signal - number to display a check or a cross symbol on the display (1-2; 1-cross; 2-check) + * @return Operation status + */ + UFR_STATUS DL_API Display_UserInterfaceSignal(int signal); + + /** + * @brief Function writes the time on the display. If the display is not connected to the Reader, the time will be displayed and remain unchanged. However, if the display is connected to the Reader, the time will be shown only for a second because the Reader is sending the correct time to the display every second. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param hour - number that represetns the hour that will be drawn on the display + * @param minute - number that represetns the minute that will be drawn on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowTime(int hour, int minute); + + /** + * @brief Function clears a specified section of the display. If xPosEND or yPosEND are set to 0, the function will automatically assume that the end postion for erasing extends to the edge of the screen (i.e., xPosEND will default to the display's maximum width, and yPosEND will default to it's maximum height). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param xPos - number containing X coordinate to clear on the display, start position + * @param xPosEND - number containing X coordinate to clear on the display, end position + * @param yPos - number containing Y coordinate to clear on the display, start position + * @param yPosEND - number containing Y coordinate to clear on the display, end position + * @return Operation status + */ + UFR_STATUS DL_API Display_EraseSection(int xPos,int xPosEND,int yPos,int yPosEND); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceData(IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceData(OUT uint8_t *data); + + + + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + // XXX: Support for multiple readers with same DLL + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + + //-------------------------------------------------------------------------------------------------- + + ///--------------------------------------------------------------------- + /** + * @brief This is the first function in the order for execution for the multi-reader support. + * The function prepares the list of connected uF-readers to the system and returns the number of list items - number of connected uFR devices. + * ReaderList_UpdateAndGetCount() scans all communication ports for compatible devices, probes open readers if still connected, if not close and marks their handles for deletion. If some device is disconnected from the system this function should remove its handle. + * As of uFCoder version 5.0.73, this function probes both FTDI & COM devices and tries to open them. + * Each call to this method will close previously opened devices by this function, scan, and open everything found. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param NumberOfDevices how many compatible devices are connected to the system + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_UpdateAndGetCount(VAR int32_t *NumberOfDevices); + + /** + * @brief Used to retrieve information about a reader found & connected via ReaderList_UpdateAndGetCount(). + * This should be executed for each device based on number of devices found, providing valid index. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex index of the device in the readers list + * @param DeviceHandle assigned Handle + * @param DeviceSerialNumber device serial number + * @param DeviceType device type - device identification in AIS database + * @param DeviceFWver version of firmware + * @param DeviceCommID device identification number (master) + * @param DeviceCommSpeed communication speed + * @param DeviceCommFTDISerial FTDI COM port identification + * @param DeviceCommFTDIDescription FTDI COM port description + * @param DeviceIsOpened is Device opened + * @param DeviceStatus actual device status + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetInformation( // + uint32_t DeviceIndex, // index of the device to get information from + VAR UFR_HANDLE *DeviceHandle, //// assigned Handle + OUT c_string *DeviceSerialNumber, //// device serial number + VAR int *DeviceType, //// device type - device identification in AIS database + OUT c_string *DeviceFWver, //// version of firmware + VAR int *DeviceCommID, //// device identification number (master) + VAR int *DeviceCommSpeed, //// communication speed + OUT c_string *DeviceCommFTDISerial, //// FTDI COM port identification + OUT c_string *DeviceCommFTDIDescription, //// FTDI COM port description + VAR int *DeviceIsOpened, //// is Device opened + VAR int *DeviceStatus //// actual device status + ); + + /** + * @brief Force handle deletion when you identify that the reader is no longer connected, and want to release the handle immediately. If the handle exists in the list of opened devices, function would try to close communication port and destroy the handle. + * When uFR reader is disconnected, ReaderList_UpdateAndGetCount() will do that (destroy) automatically in next execution. + * + * @param DeviceHandle The handle that will be destroyed + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Destroy(UFR_HANDLE *DeviceHandle); + + /** + * @brief This method is used for manual addition of uFR devices to the list. Parameters used are the same as in ReaderOpenEx() method. Use this method if the device was not previously discovered by the ReaderList_UpdateAndGetCount() method. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceHandle the handle that will be assigned for interacting with the specified reader on success. + * @param reader_type Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_name Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_interface Refer to ReaderOpenEx() for detailed description of this parameter. arg Refer to ReaderOpenEx() for detailed description of this parameter. + * @param arg Refer to ReaderOpenEx() for detailed description of this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Add(UFR_HANDLE *DeviceHandle, uint32_t reader_type, + c_string port_name, uint32_t port_interface, void *arg); + + /** + * @brief Tries to re-open the device based on the serial number of the device. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param hndUFR handle of the uFR device + * @param Device_SN Serial number of the device contained as char array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenBySerial(VAR UFR_HANDLE *hndUFR, const char Device_SN[16]); + + // XXX: Obsolete functions - remain for backward compatibility + /** + * @brief + * Gets reader’s reader serial number as a pointer to 4 byte value, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulSerialNumber Contains reader serial number as a 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialByIndex(int32_t DeviceIndex, VAR uint32_t *lpulSerialNumber); + + /** + * @brief Gets reader’s descriptive name as a array of 8 chars, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param pSerialDescription Contains reader serial number as array of 8 chars + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialDescriptionByIndex(int32_t DeviceIndex, OUT uint8_t pSerialDescription[8]); + + /** + * @brief Gets devices reader type based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulReaderType Contains reader type as 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetTypeByIndex(int32_t DeviceIndex, VAR uint32_t *lpulReaderType); + + /** + * @brief Gets devices FTDI serial port number based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Serial Contains FTDI serial number as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDISerialByIndex(int32_t DeviceIndex, OUT char **Device_Serial); + + /** + * @brief Gets devices FTDI description based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Description FTDI description as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDIDescriptionByIndex(int32_t DeviceIndex, OUT char **Device_Description); + + /** + * @brief Tries to re-open the device based on the device index. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenByIndex(const int32_t DeviceIndex, VAR UFR_HANDLE *hndUFR); + + //-------------------------------------------------------------------------------------------------- + + // open first/next Reader and return handle - better to use ReaderList_OpenByIndex() + /** + * @brief Multi reader support. Open reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s, or if you have only one reader attached to another power supply (not your PC) it will open that reader based on it’s working mode (TCP or UDP). If you have more than one µFR Online device, ReaderOpen function will open the first one found, for opening another device, use ReaderOpenEx instead. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenM(VAR UFR_HANDLE *hndUFR); + +#ifdef ESP_PLATFORM + /** + * @brief @param hndUFR handle of the uFR device + * @param port_num + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderOpenM(VAR UFR_HANDLE *hndUFR, uint32_t port_num); +#endif + + /** + * @brief Multi reader support. Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderCloseM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTypeM(UFR_HANDLE hndUFR, OUT uint32_t *lpulReaderType); + + /** + * @brief Multi reader support. Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumberM(UFR_HANDLE hndUFR, OUT uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnectedM(UFR_HANDLE hndUFR, VAR uint32_t *connected); + + /** + * @brief Multi reader support. Store a new key or change existing key under provided index parameter.The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Multi reader support. Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. This function turns sound and light reader signals. Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignalM(UFR_HANDLE hndUFR, uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Multi reader support. From version 5.0.68. + * Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolumeM(UFR_HANDLE hndUFR, uint8_t sound_volume); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExtM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExtM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @param hndUFR handle of the uFR device + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * Multi reader support. From library version 5.0.36 and firmware version 5.0.37 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSakM(UFR_HANDLE hndUFR, uint16_t *atqa, uint8_t *sak); + + /** + * @brief Multi reader support. Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authenticationwith key A or key B:use KeyA - MIFARE_AUTHENT1A = 0x60or KeyB - MIFARE_AUTHENT1B = 0x61For NTAG 21x, Ultralight EV1 and other T2T tags supportingPWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead()or LinearRead_PK() functions. Value 0x60 with LinearRead() orLinearRead_PK() functions means “without PWD_AUTH“ and in thatcase you can send for ucReaderKeyIndex or aucProvidedKeyparameters anything you want without influence on the result. ForNTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTHyou can use _AKM1 or _AKM2 function variants only withoutPWD_AUTH in any case of the valid values (0x60 or 0x61) providedfor this parameter.For Mifare Plus tags (PK mode) defines whether to performauthentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCardM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKeyM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafeM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode)For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters + + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using absolute Block address. + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PKM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * Multi reader support. + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Multi reader support. Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + // New commands (for RTC & I2C EEPROM): + /** + * @brief Multi reader support. Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTimeM(UFR_HANDLE hndUFR, VAR uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into the device's RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password time + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTimeM(UFR_HANDLE hndUFR, IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Multi reader support. This function is used in Common, Advance and Access Control set of functions. + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPasswordM(UFR_HANDLE hndUFR, IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM. Maximal length of array is 128 bytes. Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWriteM(UFR_HANDLE hndUFR, IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescriptionM(UFR_HANDLE hndUFR, OUT uint8_t pSerialDescription[8]); + + // New since version 2.0: + /** + * @brief Multi reader support. Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumberM(UFR_HANDLE hndUFR, VAR uint8_t *build); + + /** + * @brief Multi reader support. This function returns UID of card actually present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief Multi reader support. This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi card mode: + //------------------------------------------------------------------------------ + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCardsM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + + /** + * @brief Multi reader support. Before calling this function you have to call EnumCards() first. + * For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCardsM(UFR_HANDLE hndUFR, OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + + /** + * @brief Multi reader support. Selects one of the cards which UID is on the actual UID list of the enumerated cards. If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCardM(UFR_HANDLE hndUFR, IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief Multi reader support. If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCardM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatusM(UFR_HANDLE hndUFR, VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns card type according to DlogicCardType enumeration. For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardTypeM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType); + + /** + * @brief Multi reader support. + * This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturerM(UFR_HANDLE hndUFR, OUT char* card_manufacturer_str); + + + /** + * @brief Multi reader support. This function returns 8 bytes of the T2T version. All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersionM(UFR_HANDLE hndUFR, OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Multi reader support. Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpulLinearSize pointer to variable which contain size of user data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSizeM(UFR_HANDLE hndUFR, VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * Multi reader support. From library version 5.0.59 and firmware version 5.0.60 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatusM(UFR_HANDLE hndUFR, OUT uint8_t *tt_message, VAR uint8_t *tt_status); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @param hndUFR handle of the uFR device + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @ingroup Card_Tag_M + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalDataM(UFR_HANDLE hndUFR, uint8_t data[32], uint32_t *len); + + /** + * @brief Multi reader support. Function returns reader’s serialized discovery loop structure i.e. C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetupM(UFR_HANDLE hndUFR, uint8_t *setupStruct, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoopM(UFR_HANDLE hndUFR, const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Multi reader support. Function returns the AID set in the reader to retrieve the mobile phone's unique ID. If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAidM(UFR_HANDLE hndUFR, uint8_t *aid, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAidM(UFR_HANDLE hndUFR, const uint8_t *aid, uint32_t len); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfigM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtpM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlotM(UFR_HANDLE hndUFR, uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKeyM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencryptedM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZoneM(UFR_HANDLE hndUFR, uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZoneM(UFR_HANDLE hndUFR, uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatusM(UFR_HANDLE hndUFR, VAR uint8_t *bool_config_zone_locked, + VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevisionM(UFR_HANDLE hndUFR, uint8_t revision[4]); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProModeM(UFR_HANDLE hndUFR, VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProModeM(UFR_HANDLE hndUFR, const uint32_t ReaderProMode); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_InitializeM(UFR_HANDLE hndUFR, IN const uint8_t *TBSerialString, uint16_t job_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCardM(UFR_HANDLE hndUFR, const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextM(UFR_HANDLE hndUFR, const uint32_t code_type, const uint32_t from_timestamp, + const uint32_t to_timestamp, const uint32_t additional_data_size, + IN const uint8_t additional_data[], VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSNM(UFR_HANDLE hndUFR, OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSNM(UFR_HANDLE hndUFR, VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSNM(UFR_HANDLE hndUFR, OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Multi reader support. Function returns TNF, type of record, ID and payload from the NDEF record. NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Multi reader support. Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, uint8_t *type_length, + IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, uint32_t *payload_length, + VAR uint8_t *card_formated); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroringM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_ttM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_countM(UFR_HANDLE hndUFR, VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, + OUT uint8_t *ndef_record_array, VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Multi reader support. Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_recordsM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initializationM(UFR_HANDLE hndUFR); + + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + + /** + * @brief Multi reader support. Function stores a message record for NTAG emulation mode into the reader. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefM(UFR_HANDLE hndUFR, uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, + uint8_t id_length, IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief Multi reader support. Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function returns current ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParamsM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. This command set ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParamsM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param is_field_present contains 0 if external field isn’t present or 1 if field is present. + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldStateM(UFR_HANDLE hndUFR, VAR uint8_t *is_field_present); + + /** + * @brief Multi reader support. Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. From library version 5.0.31, and firmware version 5.0.33 + * Function stores a message record for NTAG emulation mode into the reader in the RAM. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRamM(UFR_HANDLE hndUFR, uint8_t tnf, uint8_t *type_record, uint8_t type_length, + uint8_t *id, uint8_t id_length, uint8_t *payload, uint32_t payload_length); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking_M + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureM(UFR_HANDLE hndUFR, IN uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], + VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExtM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief Multi reader support. This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, uint32_t inc_value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successfulfunction execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterM(UFR_HANDLE hndUFR, VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RKM(UFR_HANDLE hndUFR, VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PKM(UFR_HANDLE hndUFR, VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Multi reader support. Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode sets idle mode value + * @param card_detection_mode sets card detection mode value + * @param idle_color sets idle color + * @param card_detection_color sets card detection color + * @param enabled value that enables it (1) or disables it (0) + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode returns idle mode value + * @param card_detection_mode returns card detection mode value + * @param idle_color returns idle color + * @param card_detection_color returns card detection color + * @param enabled returns 1 if enabled, 0 if disabled + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_numberM(UFR_HANDLE hndUFR, VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, VAR uint8_t *start_minute, + VAR uint8_t *end_hour, VAR uint8_t *end_minute, OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_recordM(UFR_HANDLE hndUFR, uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, + uint8_t begin_hour, uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, + uint8_t end_hour, uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_recordM(UFR_HANDLE hndUFR, VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, + VAR uint8_t *end_month, VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_typeM(UFR_HANDLE hndUFR, uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_typeM(UFR_HANDLE hndUFR, VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_durationM(UFR_HANDLE hndUFR, uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_durationM(UFR_HANDLE hndUFR, VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_durationM(UFR_HANDLE hndUFR, uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_durationM(UFR_HANDLE hndUFR, VAR uint32_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validityM(UFR_HANDLE hndUFR, VAR int32_t *credit, VAR uint32_t *begin_year, + VAR uint32_t *begin_month, VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, VAR uint32_t *end_year, VAR uint32_t *end_month, + VAR uint32_t *end_day, VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validityM(UFR_HANDLE hndUFR, int32_t credit, uint32_t begin_year, uint32_t begin_month, + uint32_t begin_day, uint32_t begin_hour, uint32_t begin_minute, uint32_t end_year, + uint32_t end_month, uint32_t end_day, uint32_t end_hour, uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint8_t *right_record_type, + OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counterM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, + uint16_t last_reader_nr, uint8_t start_hour, uint8_t start_minute, + uint8_t end_hour, uint8_t end_minute, IN uint8_t *days, + uint8_t max_daily_counter); + + //============================================================================= + + /** + * @brief Multi reader support. Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOnM(UFR_HANDLE hndUFR, uint16_t pulse_duration); + + /** + * @brief Multi reader support. Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayStateM(UFR_HANDLE hndUFR, uint8_t state); + + /** + * @brief Multi reader support. Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param intercom shows that there is voltage at the terminals for intercom connection, or not + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoStateM(UFR_HANDLE hndUFR, VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief + * Multi reader support. Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControlM(UFR_HANDLE hndUFR, uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Multi reader support. This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControlM(UFR_HANDLE hndUFR, uint8_t light_status); + + /** + * @brief Multi reader support. For classic uFR PLUS devices only. + * The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.55. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControlM(UFR_HANDLE hndUFR, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.64. + * The function sets color on the RGB diodes. This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleepM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.66. + * The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. Function also sets the number of omitted activity periods, when the RGB light is off. For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriodM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSetM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, uint8_t bad_select_nr_max); + + /** + * @brief Multi reader support. The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, VAR uint8_t *bad_select_nr_max); + + /** + * @brief Multi reader support. Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSetM(UFR_HANDLE hndUFR, uint8_t seconds_wait); + + /** + * @brief Multi reader support. Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGetM(UFR_HANDLE hndUFR, VAR uint8_t *seconds_wait); + + /** + * @brief Multi reader support. This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanentlyM(UFR_HANDLE hndUFR, unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Multi reader support. Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParametersM(UFR_HANDLE hndUFR, VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Multi reader support. Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayDataM(UFR_HANDLE hndUFR, IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Multi reader support. From version 5.0.55 + * Function has the same functionality as the function SetDisplayData. New feature is the RGB port selection. Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief Multi reader support. This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequencyM(UFR_HANDLE hndUFR, uint16_t frequency); + + /** + * @brief Multi reader support. SetRgbIntensity (alias from version 5.0.55) + * Function sets the intensity of light on the display. Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensityM(UFR_HANDLE hndUFR, uint8_t intensity); + + /** + * @brief Multi reader support. GetRgbIntensity (alias from version 5.0.55) + * Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensityM(UFR_HANDLE hndUFR, VAR uint8_t *intensity); + + // ############################################################################# + // ############################################################################# + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_ModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATSM(OUT UFR_HANDLE hndUFR, uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorageM(UFR_HANDLE hndUFR); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceiveM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint32_t *ufr_status); + /** + * @brief Multi reader support. + * Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_TransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, + uint8_t data_out_len, OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, + uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * Sends C–APDU in the c_string (zero terminated) format, containing pairs of the + hexadecimal digits. Pairs of the hexadecimal digits can be delimited by any of the punctuation + characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu C_APDU as string + * @param r_apdu R_APDU returned as string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceiveM(UFR_HANDLE hndUFR, IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief Multi reader support. + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are + sent and receive in the form of the byte arrays. There is obvious need for a c_apdu_len and + *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, + respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, + VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief Multi reader support. + * This is “exploded binary” alternative function intended for support APDU commands in ISO 14443- + 4A tags. APDUTransceive() receives separated parameters which are an integral part of the C– + APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls lcs + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, + uint32_t Nc, OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chainM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceiveM(UFR_HANDLE hndUFR, uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselectM(UFR_HANDLE hndUFR, uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceiveM(UFR_HANDLE hndUFR, uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, + uint8_t crypto1, uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Multi reader support. Function sets the parameters for transceive mode. If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_startM(UFR_HANDLE hndUFR, uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief Multi reader support. + * The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enableM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceiveM(UFR_HANDLE hndUFR, IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, + uint32_t bytes_to_receive, VAR uint32_t *rcv_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interfaceM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_GenericM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDUM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4M(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Using this function you can select the appropriate application on the card. For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAidM(UFR_HANDLE hndUFR, IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief Multi reader support. In JCApp cards you can put two types of asymmetric crypto keys. Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + const IN uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_type key_type + * @param key_index key_index + * @param key_designator key_designator + * @param key_bit_len key_bit_len + * @param params params + * @param params_size params_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPairM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, uint8_t key_designator, + uint16_t key_bit_len, IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBeginM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *chunk, uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdateM(UFR_HANDLE hndUFR, IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Multi reader support. Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEndM(UFR_HANDLE hndUFR, VAR uint16_t *sig_len); + + /** + * @brief Multi reader support. + * This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignatureM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *plain_data, uint16_t plain_data_len, VAR uint16_t *sig_len, + IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, + uint8_t id_size); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Multi reader support. + * Using this function you can delete certificate objects from a card. This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCertM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index); + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjIdM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + + /** + * @brief Multi reader support. + * This function is used to login to the JCApp with an appropriate PIN code. Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLoginM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief Multi reader support. This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemainingM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief Multi reader support. This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChangeM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief Multi reader support. + * This function is used to unblock PIN code which is specified by the SO parameter. + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblockM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, + OUT uint8_t *exponent, VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *keyW, VAR uint16_t *keyWSize, OUT uint8_t *field, + VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, + VAR uint16_t *g_size, OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, + VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); // when keyW == NULL, returns size + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBitsM(UFR_HANDLE hndUFR, uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list_size Pointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSizeM(UFR_HANDLE hndUFR, VAR uint32_t *list_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFilesM(UFR_HANDLE hndUFR, OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief Multi reader support. + * This function returns file size indexed by the parameter card_file_index, on successful execution. Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file which size we want to get + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSizeM(UFR_HANDLE hndUFR, uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated d Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief Multi reader support. + * This function reads a file from the DLStorage card directly to the new file on the host file-system. If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. Parameter data_size defines the amount of data to be written in the file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief Multi reader support. + * This function writes file content from the host file-system to the new file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * After successful call to this function, the file on the DLStorage card will be deleted. Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFileM(UFR_HANDLE hndUFR, uint8_t file_index); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBacM(UFR_HANDLE hndUFR, IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], + OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * Use this function to read files from the eMRTD NFC tag. You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param file_index file index + * @param output buffer that storese output + * @param output_length length of the returned output + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt send_sequence_cnt + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *file_index, VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * This function validates data groups read from the eMRTDocument. All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * ________________ + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidateM(UFR_HANDLE hndUFR, IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, + uint32_t verbose_level, OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + // ############################################################################# + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Start(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StartM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Stop(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StopM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Start(void); // Alias for uFR_DESFIRE_Start() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StartM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StartM() + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Stop(void); // Alias for uFR_DESFIRE_Stop() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StopM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StopM() + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUidM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3desM(UFR_HANDLE hndUFR, IN uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Provided Key mode (PK) + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function returns the available bytes on the card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param free_mem_byte pointer to free memory size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFreeMemM(UFR_HANDLE hndUFR, VAR uint32_t *free_mem_byte, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCardM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * Provided Key mode (PK) + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + /** + * @brief Multi reader support. Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Provided Key mode (PK) + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key provided key + * Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * No authentication + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + // 121212 + /** + * @brief Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. + * + * If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * Multi reader support + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationd2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfigurationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. Provided Key mode (PK) + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. No authentication + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Function allows to set card master key, and application master key configuration settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr ordinal number of AES key in the reader + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_2k3des_key_nr, uint8_t aid_key_no, uint8_t old_2k3des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_2k3des_key_nr, uint8_t aid_key_no, + uint8_t old_2k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key_nr ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_des3k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_3k3des_key_nr, uint8_t aid_key_no, + uint8_t old_3k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of the key stored in the reader + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. 128 bit AES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_des_key[8], uint8_t aid_key_no, IN uint8_t old_des_key[8], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_des_key[8], uint8_t aid_key_no, + IN uint8_t old_des_key[8], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key pointer to 32 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key 24 bytes array that represent 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key 24 bytes array that represent current 3K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des3k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_3k3des_key[24], uint8_t aid_key_no, + IN uint8_t old_3k3des_key[24], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key pointer to array contained new AES key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t auth_key_type, IN uint8_t *new_key, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr key index of AES key stored in the reader that will be new AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr key index of AES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeAesKey_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des3k_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_des3k_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange3k3desKey_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des3k_key_nr, uint8_t aid_key_no, uint8_t old_des3k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows you to change any AES key on the card. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. *only uFR CS with SAM support + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of a key stored in the reader that will be new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief + * Function writes AES key (16 bytes) into reader. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key in the reader (0 - 15) + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_no, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Function writes AES key (16 bytes) into reader. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param key_no ordinal number of key in the reader (0 - 15) + * @param key pointer to array containing the key + * @param key_type enumerated key type (0 - 3) + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteKeyM(UFR_HANDLE hndUFR, uint8_t key_no, IN uint8_t *key, uint8_t key_type); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIdsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_no_auth_M(UFR_HANDLE hndUFR, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t number_of_records, uint16_t record_size, uint8_t communication_settings, + uint8_t *data, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + uint8_t *data, + uint16_t *card_status, + uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuth_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileDesAuth_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile2k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. Provided Key mode (PK) + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multireader support. 128 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no ey for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsSdmAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows changing of file settings + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * *only uFR CS with SAM support + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetTransactionTimerAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). . + * + * Multi reader support. + * From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param card_uid 7 bytes length card UID + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireUidReadECCSignatureM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, OUT uint8_t *card_uid, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aesM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOnM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function prohibits the blinking of the green diode independently of the user's signaling command. LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOffM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOnM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOffM(UFR_HANDLE hndUFR); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t CWGsNOff, uint8_t ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API FastFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersM(UFR_HANDLE hndUFR, uint8_t *mui, uint8_t *serial_nr, uint8_t *hw_type, uint8_t *hw_ver, + uint8_t *device_type, uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrateM(UFR_HANDLE hndUFR, OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersPN7462_M(UFR_HANDLE hndUFR, uint8_t *die_id, uint8_t *serial_nr, + + uint8_t *hw_type, uint8_t *hw_ver, uint8_t *device_type, + uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + // SAM + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_rawM(UFR_HANDLE hndUFR, OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_versionM(UFR_HANDLE hndUFR, VAR SAM_HW_TYPE *sam_type, VAR uint8_t *sam_uid); + + /** + * @brief Multi reader support. Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_rawM(UFR_HANDLE hndUFR, uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_v ADD DESCRIPTION + * @param des_key ADD DESCRIPTION + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_desM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_keyM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param master_aes_key ADD DESCRIPTION + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_modeM(UFR_HANDLE hndUFR, IN uint8_t *master_aes_key, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plainM(UFR_HANDLE hndUFR, IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *keyA, + IN uint8_t *keyB, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_ULC_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_desfire_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, + uint8_t ver_a, IN uint8_t *aes_key_ver_b, uint8_t ver_b, + IN uint8_t *aes_key_ver_c, uint8_t ver_c, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, uint8_t sam_lock_unlock, + uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKeyM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * Multi reader support. + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeableM(UFR_HANDLE hndUFR); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * Multi reader support. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfResetM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOnM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch off RF field at the reader. + * + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOffM(UFR_HANDLE hndUFR); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderIdM(UFR_HANDLE hndUFR, uint8_t *reader_id); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePersoM(UFR_HANDLE hndUFR, uint16_t address, IN uint8_t *data); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPersoM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param card_master_key pointer to 16 byte array containing the card master key + * @param card_config_key pointer to 16 byte array containing the card configuration key + * @param level_2_switch_key pointer to 16 byte array containing the key for switch to security level 2 + * @param level_3_switch_key pointer to 16 byte array containing the key for switch to security level 3 + * @param level_1_auth_key pointer to 16 byte array containing the key for optional authentication at security level 1 + * @param select_vc_key pointer to 16 byte array containing the key for virtual card selection + * @param prox_chk_key pointer to 16 byte array containing the key for proximity check + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling + * @param vc_poll_mac_key pointer to 16 byte array containing the MAC key for virtual card polling + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimalM(UFR_HANDLE hndUFR, IN uint8_t *card_master_key, IN uint8_t *card_config_key, + IN uint8_t *level_2_switch_key, IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, + IN uint8_t *select_vc_key, IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, + IN uint8_t *vc_poll_mac_key); + + /** + * @brief Multi reader support. Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, + uint8_t prox_check_use); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ADordinary number of current sector key stored into reader that wile become new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKeyM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, + OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @param hndUFR handle of the uFR device + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PKM(UFR_HANDLE hndUFR, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief Multi reader support. Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PKM(UFR_HANDLE hndUFR, IN uint8_t *key); + + /** + * @brief Multi reader support. No authentication + * This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_authM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + /** + * @brief Multi reader support. No authentication + * This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_auth_internalM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_key_internalM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_internalM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + + // ESP32 + /** + * @brief Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. + * + * Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayData(IN uint8_t *display_data, IN uint8_t data_length, uint16_t duration); + + /** + * @brief Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderReset(void); + + /** + * @brief It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM of uFR Online. + * + * Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param time pointer to the array containing current date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTime(OUT uint8_t *time); + + /** + * @brief Function sets the date and time into uFR Online RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOState(uint8_t pin, uint8_t state); + + /** + * @brief Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOState(OUT uint8_t *state); + + /** + * @brief Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReader(uint8_t reader); + + /** + * @brief Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param SerialNumber pointer to SerialNumber variable. “SerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumber(VAR uint32_t *SerialNumber); + + /** + * @brief Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersion(OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOff(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifi(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableWifi(void); + + // NDEF MESSAGES + //---------------------------------------------------------- + + enum NDEF_STORAGE_MODE + { + STORE_INTO_READER = 0, + STORE_INTO_CARD + }; + + enum NDEF_SKYPE_ACTION + { + CALL = 0, + CHAT + }; + + // WiFi NDEF authentication type + enum WIFI_AUTH_TYPE + { + OPEN = 0, + WPA_PERSONAL, + WPA_ENTERPRISE, + WPA2_ENTERPRISE, + WPA2_PERSONAL + }; + + // WiFi NDEF encryption type + enum WIFI_ENC_TYPE + { + NONE = 0, + WEP, + TKIP, + AES, + AES_TKIP + }; + + /** + * @brief + * Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFi(uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, uint8_t encryption_type, + IN const char *password); + + /** + * @brief Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters)(e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BT(uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMS(uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Bitcoin(uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocation(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestination(uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Email(uint8_t ndef_storage, IN const char *email_address, IN const char *subject, IN const char *message); + + /** + * @brief Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Address(uint8_t ndef_storage, IN const char *address); + + /** + * @brief Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidApp(uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Store text as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Text(uint8_t ndef_storage, IN const char *text); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetView(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Skype(uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Whatsapp(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Viber(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Contact(uint8_t ndef_storage, IN const char *name, IN const char *company, IN const char *address, + IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Phone(uint8_t ndef_storage, IN const char *phone_number); + + /** + * @brief Multi reader support. Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFiM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, + uint8_t encryption_type, IN const char *password); + + /** + * @brief Multi reader support. Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters) (e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BTM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Multi reader support. Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMSM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Multi reader support. Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BitcoinM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Multi reader support. Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_EmailM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *email_address, IN const char *subject, + IN const char *message); + + /** + * @brief Multi reader support. Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AddressM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *address); + + /** + * @brief Multi reader support. Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Multi reader support. Store text as NDEF message into reader or into card. + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_TextM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *text); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetViewM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SkypeM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Multi reader support. Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WhatsappM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ViberM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ContactM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *name, IN const char *company, + IN const char *address, IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Multi reader support. Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_PhoneM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number); + //--------------------------------------------------------------------------------------------- + /** + * @brief Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF + * + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFi(OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, OUT char *password); + + /** + * @brief Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Bitcoin(OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocation(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF + * + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestination(OUT char *destination); + + /** + * @brief Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Email(OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF + * + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Address(OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF + * + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidApp(OUT char *package_name); + + /** + * @brief Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF + * + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Text(OUT char *text); + + /** + * @brief Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetView(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF + * + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Skype(OUT char *user_name, OUT char *action); + + /** + * @brief Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Whatsapp(OUT char *message); + + /** + * @brief Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Viber(OUT char *message); + + /** + * @brief Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF + * + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Contact(OUT char *vCard); + + /** + * @brief Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Phone(OUT char *phone_number); + + /** + * @brief Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMS(OUT char *phone_number, OUT char *message); + + /** + * @brief Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BT(OUT char *bt_mac_address); + + /** + * @brief Multi reader support. Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFiM(UFR_HANDLE hndUFR, OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, + OUT char *password); + + /** + * @brief Multi reader support. Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BitcoinM(UFR_HANDLE hndUFR, OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, OUT char *destination); + + /** + * @brief Multi reader support. Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_EmailM(UFR_HANDLE hndUFR, OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AddressM(UFR_HANDLE hndUFR, OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, OUT char *package_name); + + /** + * @brief Multi reader support. Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_TextM(UFR_HANDLE hndUFR, OUT char *text); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetViewM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SkypeM(UFR_HANDLE hndUFR, OUT char *user_name, OUT char *action); + + /** + * @brief Multi reader support. Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WhatsappM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ViberM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ContactM(UFR_HANDLE hndUFR, OUT char *vCard); + + /** + * @brief Multi reader support. Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_PhoneM(UFR_HANDLE hndUFR, OUT char *phone_number); + + /** + * @brief Multi reader support. Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMSM(UFR_HANDLE hndUFR, OUT char *phone_number, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BTM(UFR_HANDLE hndUFR, OUT char *bt_mac_address); + + /** + * @brief Used to parse NDEF record into separate parameters + * + * @ingroup Card_Tag_NDEF + * + * @param type_record pointer to the array containing record type + * @param type_len length of the record type + * @param payload pointer to the array containing record payload + * @param payload_len length of the record payload + * + * @return Operation status + */ + c_string DL_API ParseNdefMessage(IN uint8_t *type_record, uint8_t type_len, IN uint8_t *payload, uint32_t payload_len); + + // NT4H + + /** + * @brief Multi reader support. Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parametersM(UFR_HANDLE hndUFR, uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function returns file settings. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext); + + /** + * @brief Multi reader support. Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_ridM(UFR_HANDLE hndUFR, uint8_t aes_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uidM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_keyM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctrM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. No authentication + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_authM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signatureM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_statusM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_authM(UFR_HANDLE hndUFR, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_ttM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_fileM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief Multi reader support. Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint16_t duration); + + /** + * @brief Multi reader support. Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPasswordM(UFR_HANDLE hndUFR, uint8_t *old_password, uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM of uFR Online. Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWriteM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size, uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromReadM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into uFR Online RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *password, uint8_t *time); + + /** + * @brief Multi reader support. Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOStateM(UFR_HANDLE hndUFR, uint8_t pin, uint8_t state); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOStateM(UFR_HANDLE hndUFR, uint8_t *state); + + /** + * @brief Multi reader support. Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReaderM(UFR_HANDLE hndUFR, uint8_t reader); + + /** + * @brief Multi reader support. Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumberM(UFR_HANDLE hndUFR, uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersionM(UFR_HANDLE hndUFR, OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Multi reader support. Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOffM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableOnWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceDataM(UFR_HANDLE hndUFR, IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceDataM(UFR_HANDLE hndUFR, OUT uint8_t *data); + + + /** + * @brief Multi reader support. As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + + UFR_STATUS DL_API COMTransceiveM(UFR_HANDLE hndUFR, IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General + * + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + UFR_STATUS DL_API COMTransceive(IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + // DLL version ---------------------------------------------------------------- + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + uint32_t DL_API GetDllVersion(void); + + /* + * Get "exploded" dll version example: + * + * #include + * #include + * + * void main(int argc, char *argv[]) + * { + * uint32_t dwDllVersion = 0; + * uint32_t dwDllMajorVersion = 0; + * uint32_t dwDllMinorVersion = 0; + * uint32_t dwDllBuild = 0; + * + * dwDllVersion = GetDllVersion(); + * + * // "explode" the dll version: + * dwDllMajorVersion = (DWORD)(LOBYTE(LOWORD(dwDllVersion))); + * dwDllMinorVersion = (DWORD)(HIBYTE(LOWORD(dwDllVersion))); + * + * // Get the dll build number. + * dwDllBuild = (DWORD)(HIWORD(dwDllVersion)); + * + * printf("Dll version is %ld.%ld (%ld)\n", dwDllMajorVersion, + * dwDllMinorVersion, + * dwDllBuild); + * } + * + */ + // Originality Check (performs the check is the chip on the card/tag NXP genuine): + /** + * @brief This function depends on OpenSSL crypto library. Since OpenSSL crypto library is dynamically linked during execution, the only prerequisite for a successful call to this function is that the libeay32.dll is in the current folder (valid for Windows) and / or libcrypto.so is in the environment path (e.g. LD_LIBRARY_PATH on Linux / macOS). OriginalityCheck() performs the check if the chip on the card / tag is NXP genuine. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param signature ECCSignature acquired by call to the ReadECCSignature() function. + * @param uid Card UID. Best if the card UID is acquired by previous call to the ReadECCSignature() function. + * @param uid_len Card UID length. Best if the card UID length is acquired by previous call to the ReadECCSignature() function. + * @param DlogicCardType Card type. Best if the DlogicCardType is acquired by previous call to the ReadECCSignature() function. + * + * @return Operation status + */ + UFR_STATUS DL_API OriginalityCheck(IN const uint8_t *signature, IN const uint8_t *uid, uint8_t uid_len, uint8_t DlogicCardType); + // Returns: + // UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND in case there is no OpenSSL library (libeay32.dll) in current folder or path + // UFR_OPEN_SSL_DYNAMIC_LIB_FAILED in case of OpenSSL library error (e.g. wrong OpenSSL version) + // UFR_NOT_NXP_GENUINE if chip on the card/tag is NOT NXP genuine + // UFR_OK is chip on the card/tag is NXP GENUINE + + //// debug functions: + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + c_string DL_API GetDllVersionStr(void); + + /** + * @brief Returns UFR_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param status UFR_STATUS status variable + * + * @return Operation status + */ + c_string DL_API UFR_Status2String(const UFR_STATUS status); + + /** + * @brief Returns UFR_SESSION_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param session_status UFR_SESSION_STATUS status variable + * + * @return c_string value of the status code + */ + c_string DL_API UFR_SessionStatus2String(const UFR_SESSION_STATUS session_status); + + /** + * @brief Returns card type as a c_string instead of byte value + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param dl_type_code card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + c_string DL_API UFR_DLCardType2String(uint8_t dl_type_code); + +//// Helper functions: +#ifndef _WIN32 + + unsigned long GetTickCount(void); + +#endif // #ifndef _WIN32 + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information + * + * @return The reader's descriptive name + */ + c_string DL_API GetReaderDescription(void); + + /** + * @brief Multi reader support. This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * + * @return Returns the reader's descriptive name. + */ + c_string DL_API GetReaderDescriptionM(UFR_HANDLE hndUFR); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +//#ifdef _WIN32 || __linux__ + +//#else +//#endif // _WIN32 + + + +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +#ifdef __ANDROID__ +#include + + extern JNIEnv *global_env; + extern jclass global_class; + extern jclass usb_global_class; + + /** + + * + * @param env + * @param class1 + * + * @return Operation status + */ + void DL_API initVM(JNIEnv *env, jclass class1); +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __APPLE__ +#include + #if TARGET_OS_IPHONE + typedef void (*CardDetectedCallback)(void* _Nonnull context,const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(void* _Nonnull context); + typedef void (*SessionErrorCallback)(void* _Nonnull context, UFR_SESSION_STATUS error_code, const char* error_description); + /** + * @brief For iOS only: This function is used to set message displayed when the NFC Session window is started
+ * E.g 'Read the tag with the phone' + * NFC Session can be started via ReaderOpenEx() and appropriate parameters, or openNFCSession() + * @since uFCoder library version 6.0.0 + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + void setNFCMessage(const char *message); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * @param context pointer to UIView that bridges Swift with native code. e.g `let ble_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(void* _Nonnull context, const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + void DL_API closeBLESession(void); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param context pointer to UIView that bridges Swift with native code. e.g `let nfc_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(void* _Nonnull context, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + #else + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); + + #endif // TARGET_OS_IPHONE +#endif // __APPLE__ + +#ifdef __ANDROID__ + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param reader_sn uFR Online reader serial number (e.g ONXXXXXX) + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param session_error_callback TEST + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openBLESession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeBLESession(void); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); +#endif // __ANDROID__ + +#if defined(_WIN32) || defined(__linux__) + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief This function is used to enable asynchronous event-driven API callbacks.
+ * Prerequisites: ReaderOpen() or ReaderOpenEx() must be called first and must return `UFR_OK` status to open connection with the reader
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by StartAsyncSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + UFR_STATUS DL_API StopAsyncSession(); + +#endif // _WIN32 || __linux__ + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardDetectedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardDetectedCallback(CardDetectedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardRemovedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardRemovedCallback(CardRemovedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'SessionErrorCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setSessionErrorCallback(SessionErrorCallback callback); + + + +#endif /* uFCoder_H_ */ diff --git a/lib/ios/libuFCoder-ios-static.a b/lib/ios/libuFCoder-ios-static.a new file mode 100644 index 0000000000000000000000000000000000000000..a5a1141c2f7dc2a9e84157d443194a109c91079a Binary files /dev/null and b/lib/ios/libuFCoder-ios-static.a differ diff --git a/lib/ios_framework/uFCoder.xcframework/Info.plist b/lib/ios_framework/uFCoder.xcframework/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..d3c5508a8bca1bc75c4a87916396bd61d58b35be --- /dev/null +++ b/lib/ios_framework/uFCoder.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libuFCoder-ios_simulator-static.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libuFCoder-ios_simulator-static.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libuFCoder-ios-static.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libuFCoder-ios-static.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/module.modulemap b/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/module.modulemap new file mode 100644 index 0000000000000000000000000000000000000000..ff3803f4dc348fcaa9330a568f7cf7a94a1c6333 --- /dev/null +++ b/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/module.modulemap @@ -0,0 +1,5 @@ +module uFCoder { + header "uFCoder.h" + + export * +} diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/uFCoder.h b/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/uFCoder.h new file mode 100644 index 0000000000000000000000000000000000000000..2dd864183dbc98fe670f68c7c8b1cec9cfd01197 --- /dev/null +++ b/lib/ios_framework/uFCoder.xcframework/ios-arm64/Headers/uFCoder.h @@ -0,0 +1,49439 @@ +/* + * uFCoder.h + * + * library version: 6.0.9 + * + * Created on: 2009-01-14 + * Last edited: 2025-03-05 + * + * Author: D-Logic + */ +#ifndef uFCoder_H_ +#define uFCoder_H_ + +#include +#include +#include + +#define IN // array that you pass to function +#define OUT // array that you receive from function +#define VAR // first element of array that you receive from function (single variable) + +//////////////////////////////////////////////////////////////////// +/** + * Type for representing null terminated char array ( aka C-String ) + * Array is always one byte longer ( for null character ) then string + * Memory space for array must be allocated before use. + */ +typedef const char *c_string; +//////////////////////////////////////////////////////////////////// + +#ifdef _WIN32 +// WINDOWS +#if defined(DL_CREATE_STATIC_LIB) || defined(DL_USE_STATIC_LIB) +#define DL_API +#else +#ifndef DL_uFC_EXPORTS +#ifdef _WIN_IOT +#define DL_API __declspec(dllimport) // Win IoT +#else +#define DL_API /*__declspec(dllimport) */ __stdcall // STDCALL - GCC - .NET +#endif // _WIN_IOT +#else +#define DL_API __declspec(dllexport) __stdcall +#endif // DL_uFC_EXPORTS +#endif // DL_CREATE_STATIC_LIB +#else +// Linux & MAC OS +#define DL_API +#endif // _WIN32 + +#if defined(DL_uFC_EXPORTS) || defined(DL_CREATE_STATIC_LIB) || defined(__ANDROID__) || defined(ESP_PLATFORM) || defined(IOS_PLATFORM) +typedef struct S_UFR_HANDLE *UFR_HANDLE; +#else +typedef void *UFR_HANDLE; +#endif + +// MIFARE CLASSIC type id's: +#define MIFARE_CLASSIC_1k 0x08 +#define MF1ICS50 0x08 +#define SLE66R35 0x88 // Infineon = Mifare Classic 1k +#define MIFARE_CLASSIC_4k 0x18 +#define MF1ICS70 0x18 +#define MIFARE_CLASSIC_MINI 0x09 +#define MF1ICS20 0x09 + +// DLOGIC CARD TYPE +#define TAG_UNKNOWN 0 +#define DL_MIFARE_ULTRALIGHT 0x01 +#define DL_MIFARE_ULTRALIGHT_EV1_11 0x02 +#define DL_MIFARE_ULTRALIGHT_EV1_21 0x03 +#define DL_MIFARE_ULTRALIGHT_C 0x04 +#define DL_NTAG_203 0x05 +#define DL_NTAG_210 0x06 +#define DL_NTAG_212 0x07 +#define DL_NTAG_213 0x08 +#define DL_NTAG_215 0x09 +#define DL_NTAG_216 0x0A +#define DL_MIKRON_MIK640D 0x0B +#define NFC_T2T_GENERIC 0x0C +#define DL_NT3H_1101 0x0D +#define DL_NT3H_1201 0x0E +#define DL_NT3H_2111 0x0F +#define DL_NT3H_2211 0x10 +#define DL_NTAG_413_DNA 0x11 +#define DL_NTAG_424_DNA 0x12 +#define DL_NTAG_424_DNA_TT 0x13 +#define DL_NTAG_210U 0x14 +#define DL_NTAG_213_TT 0x15 + +#define DL_MIFARE_CLASSIC_2K 0x19 +#define DL_MIFARE_MINI 0x20 +#define DL_MIFARE_CLASSIC_1K 0x21 +#define DL_MIFARE_CLASSIC_4K 0x22 +#define DL_MIFARE_PLUS_S_2K_SL0 0x23 +#define DL_MIFARE_PLUS_S_4K_SL0 0x24 +#define DL_MIFARE_PLUS_X_2K_SL0 0x25 +#define DL_MIFARE_PLUS_X_4K_SL0 0x26 +#define DL_MIFARE_DESFIRE 0x27 +#define DL_MIFARE_DESFIRE_EV1_2K 0x28 +#define DL_MIFARE_DESFIRE_EV1_4K 0x29 +#define DL_MIFARE_DESFIRE_EV1_8K 0x2A +#define DL_MIFARE_DESFIRE_EV2_2K 0x2B +#define DL_MIFARE_DESFIRE_EV2_4K 0x2C +#define DL_MIFARE_DESFIRE_EV2_8K 0x2D +#define DL_MIFARE_PLUS_S_2K_SL1 0x2E +#define DL_MIFARE_PLUS_X_2K_SL1 0x2F +#define DL_MIFARE_PLUS_EV1_2K_SL1 0x30 +#define DL_MIFARE_PLUS_X_2K_SL2 0x31 +#define DL_MIFARE_PLUS_S_2K_SL3 0x32 +#define DL_MIFARE_PLUS_X_2K_SL3 0x33 +#define DL_MIFARE_PLUS_EV1_2K_SL3 0x34 +#define DL_MIFARE_PLUS_S_4K_SL1 0x35 +#define DL_MIFARE_PLUS_X_4K_SL1 0x36 +#define DL_MIFARE_PLUS_EV1_4K_SL1 0x37 +#define DL_MIFARE_PLUS_X_4K_SL2 0x38 +#define DL_MIFARE_PLUS_S_4K_SL3 0x39 +#define DL_MIFARE_PLUS_X_4K_SL3 0x3A +#define DL_MIFARE_PLUS_EV1_4K_SL3 0x3B +#define DL_MIFARE_PLUS_SE_SL0 0x3C +#define DL_MIFARE_PLUS_SE_SL1 0x3D +#define DL_MIFARE_PLUS_SE_SL3 0x3E +#define DL_MIFARE_DESFIRE_LIGHT 0x3F + +#define DL_UNKNOWN_ISO_14443_4 0x40 +#define DL_GENERIC_ISO14443_4 0x40 +#define DL_GENERIC_ISO14443_4_TYPE_B 0x41 +#define DL_GENERIC_ISO14443_3_TYPE_B 0x42 +#define DL_MIFARE_PLUS_EV1_2K_SL0 0x43 +#define DL_MIFARE_PLUS_EV1_4K_SL0 0x44 +#define DL_MIFARE_DESFIRE_EV3_2K 0x45 +#define DL_MIFARE_DESFIRE_EV3_4K 0x46 +#define DL_MIFARE_DESFIRE_EV3_8K 0x47 + +#define DL_MOBILE_AID 0x60 +#define DL_APPLE_VAS_V1 0x6A +#define DL_APPLE_VAS_V2 0x6B +#define DL_IMEI_UID 0x80 + +// ST Product ID-s: +#define M24SR02 0x82 +#define M24SR02_AUTOMOTIVE 0x8A +#define M24SR04 0x86 +#define M24SR04_AUTOMOTIVE 0x8E +#define M24SR16 0x85 +#define M24SR16_AUTOMOTIVE 0x8D +#define M24SR64 0x84 +#define M24SR64_AUTOMOTIVE 0x8C + +// DLJavaCardTypes: +#define DLSigner81 0xA0 +#define DLSigner22 0xA1 +#define DLSigner30 0xA2 +#define DLSigner10 0xA3 +#define DLSigner145 0xAA + +enum E_CARD_IN_SAM_SLOT +{ + SAM_SLOT_MIFARE_SAM_AV2 = 1, + SAM_SLOT_GENERIC = 4 +}; + +// DLJavaCardSignerAlgorithmTypes: +enum E_SIGNER_CIPHERS +{ + SIG_CIPHER_RSA = 0, + SIG_CIPHER_ECDSA, + + SIG_CIPHER_MAX_SUPPORTED +}; + +enum E_SIGNER_RSA_PADDINGS +{ + PAD_NULL = 0, + PAD_PKCS1_V1_5, + PAD_PKCS1_PSS, + + SIG_PAD_MAX_SUPPORTED +}; +#define PAD_PKCS1 PAD_PKCS1_V1_5 + +enum E_SIGNER_DIGESTS +{ + ALG_NULL = 0, + ALG_SHA, + ALG_SHA_256, + ALG_SHA_384, + ALG_SHA_512, + ALG_SHA_224, + ALG_SHA_512_224, + ALG_SHA_512_256, + + SIG_DIGEST_MAX_SUPPORTED +}; + +enum E_KEY_TYPES +{ + TYPE_RSA_PRIVATE = 0, + TYPE_RSA_CRT_PRIVATE, + TYPE_EC_F2M_PRIVATE, + TYPE_EC_FP_PRIVATE +}; + +enum E_OBJ_TYPES +{ + OBJ_TYPE_RSA_CERT = 0, + OBJ_TYPE_EC_CERT, + OBJ_TYPE_CA_CERT, + + OBJ_TYPES_COUNT +}; + +// JCDL_AIDs +#define DL_RAW_SIZEOF_SZ(x) (sizeof(x) - 1) +#define DL_AID_RID_PLUS "\xF0" "DLogic" +#define DL_SIGNER_PIX "\x00\x01" +#define DL_STORAGE_PIX "\x01\x01" +#define DL_SIGNER_AID DL_AID_RID_PLUS DL_SIGNER_PIX +#define DL_SIGNER_AID_SIZE 9 +#define DL_STORAGE_AID DL_AID_RID_PLUS DL_STORAGE_PIX +#define DL_STORAGE_AID_SIZE 9 + +// Universal JCDL instructions: +#define INS_LOGIN 0x20 +#define INS_GET_PIN_TRIES_REMAINING 0x21 +#define INS_PIN_CHANGE 0x22 +#define INS_PIN_UNBLOCK 0x23 + +// JCDLStorage instructions: +#define INS_PIN_ENABLE 0x24 +#define INS_PIN_DISABLE 0x25 +#define INS_LIST_FILES 0x31 +#define INS_GET_FILE_SIZE 0x32 +#define INS_READ_FILE 0x33 +#define INS_WRITE_FILE 0x34 +#define INS_DELETE_FILE 0x3F + +// JCDLSigner instructions: +#define INS_SET_RSA_PRIKEY 0x51 +#define INS_GEN_RSA_KEY_PAIR 0x52 +#define INS_GET_RSA_PUBKEY_MODULUS 0x53 +#define INS_GET_RSA_PUBKEY_EXPONENT 0x54 +#define INS_DEL_RSA_KEY_PAIR 0x5F +#define INS_SET_EC_PRIKEY 0x61 +#define INS_GEN_EC_KEY_PAIR 0x62 +#define INS_GET_EC_PUBKEY 0x63 +#define INS_GET_EC_FIELD 0x64 +#define INS_GET_EC_AB 0x65 +#define INS_GET_EC_G 0x66 +#define INS_GET_EC_RK_SIZE 0x67 +#define INS_DEL_EC_KEY_PAIR 0x6F +#define INS_GET_SIGNATURE 0x71 +#define INS_PUT_OBJ 0x31 +#define INS_PUT_OBJ_SUBJECT 0x32 +#define INS_INVALIDATE_CERT 0x33 +#define INS_GET_OBJ 0x41 +#define INS_GET_OBJ_ID 0x42 +#define INS_GET_OBJ_SUBJECT 0x43 + +// Universal JCDL constants: +#define PIN_MAX_TRIES 5 +#define PIN_MIN_LENGTH 4 +#define PIN_MAX_LENGTH 8 +#define PUK_MAX_TRIES 10 +#define PUK_LENGTH 8 + +// JCDLSigner constants: +#define JC_APP_MAX_KEY_INDEX ((3) - 1) +#define JC_APP_MAX_CA_CERT_INDEX ((12) - 1) +#define JC_APP_MAX_ID_SIZE 253 +#define JC_APP_MAX_SUBJECT_SIZE 255 +#define JC_APP_MAX_SIGNATURE_LEN 256 +#define JC_APP_MAX_PIN_LENGTH 8 + +// JCDLStorage constants: +#define JC_DL_STORAGE_MAX_FILES 16 +#define JC_DL_STORAGE_MAX_FILE_SIZE (32 * 1024 - 2) // 32KB - 2 byte system reserved + +// MIFARE CLASSIC Authentication Modes: +enum MIFARE_AUTHENTICATION +{ + MIFARE_AUTHENT1A = 0x60, + MIFARE_AUTHENT1B = 0x61, +}; + +// MIFARE PLUS AES Authentication Modes: +enum MIFARE_PLUS_AES_AUTHENTICATION +{ + MIFARE_PLUS_AES_AUTHENT1A = 0x80, + MIFARE_PLUS_AES_AUTHENT1B = 0x81, +}; + +enum MIFARE_PLUS_AES_KEY_TYPE +{ + MIFARE_PLUS_AES_KEY_A = 1, + MIFARE_PLUS_AES_KEY_B = 2, +}; + +// T2T authentication constants: +enum T2T_AUTHENTICATION +{ + T2T_NO_PWD_AUTH = 0, + T2T_RKA_PWD_AUTH = 1, + T2T_PK_PWD_AUTH = 3, + T2T_WITHOUT_PWD_AUTH = 0x60, + T2T_WITH_PWD_AUTH = 0x61, +}; + +// T4T authentication constants +enum T4T_AUTHENTICATION +{ + T4T_WITHOUT_PWD_AUTH = 0x60, + T4T_PK_PWD_AUTH = 0x80, + T4T_RKA_PWD_AUTH = 0x02, +}; + +enum ADDRESS_MODE +{ + ADDRESS_MODE_BLOCK = 0, + ADDRESS_MODE_SECTOR, +}; + +#define MAX_UID_LEN 10 +#define MAX_ATS_LEN 25 +#define ECC_SIG_LEN 32 + +// API Status Codes Type: +typedef enum UFCODER_ERROR_CODES +{ + UFR_OK = 0x00, + UFR_COMMUNICATION_ERROR = 0x01, + UFR_CHKSUM_ERROR = 0x02, + UFR_READING_ERROR = 0x03, + UFR_WRITING_ERROR = 0x04, + UFR_BUFFER_OVERFLOW = 0x05, + UFR_MAX_ADDRESS_EXCEEDED = 0x06, + UFR_MAX_KEY_INDEX_EXCEEDED = 0x07, + UFR_NO_CARD = 0x08, + UFR_COMMAND_NOT_SUPPORTED = 0x09, + UFR_FORBIDEN_DIRECT_WRITE_IN_SECTOR_TRAILER = 0x0A, + UFR_ADDRESSED_BLOCK_IS_NOT_SECTOR_TRAILER = 0x0B, + UFR_WRONG_ADDRESS_MODE = 0x0C, + UFR_WRONG_ACCESS_BITS_VALUES = 0x0D, + UFR_AUTH_ERROR = 0x0E, + UFR_PARAMETERS_ERROR = 0x0F, + UFR_MAX_SIZE_EXCEEDED = 0x10, + UFR_UNSUPPORTED_CARD_TYPE = 0x11, + + UFR_COMMUNICATION_BREAK = 0x50, + UFR_NO_MEMORY_ERROR = 0x51, + UFR_CAN_NOT_OPEN_READER = 0x52, + UFR_READER_NOT_SUPPORTED = 0x53, + UFR_READER_OPENING_ERROR = 0x54, + UFR_READER_PORT_NOT_OPENED = 0x55, + UFR_CANT_CLOSE_READER_PORT = 0x56, + UFR_BLE_INVALID_PAIRING = 0x57, + + UFR_I2C_BUS_ERROR = 0x6A, + UFR_ECC_STORAGE_ERROR = 0x6B, + + UFR_WRITE_VERIFICATION_ERROR = 0x70, + UFR_BUFFER_SIZE_EXCEEDED = 0x71, + UFR_VALUE_BLOCK_INVALID = 0x72, + UFR_VALUE_BLOCK_ADDR_INVALID = 0x73, + UFR_VALUE_BLOCK_MANIPULATION_ERROR = 0x74, + UFR_WRONG_UI_MODE = 0x75, + UFR_KEYS_LOCKED = 0x76, + UFR_KEYS_UNLOCKED = 0x77, + UFR_WRONG_PASSWORD = 0x78, + UFR_CAN_NOT_LOCK_DEVICE = 0x79, + UFR_CAN_NOT_UNLOCK_DEVICE = 0x7A, + UFR_DEVICE_EEPROM_BUSY = 0x7B, + UFR_RTC_SET_ERROR = 0x7C, + + ANTI_COLLISION_DISABLED = 0x7D, + NO_TAGS_ENUMERRATED = 0x7E, + CARD_ALREADY_SELECTED = 0x7F, + + // NDEF error codes + UFR_WRONG_NDEF_CARD_FORMAT = 0x80, + UFR_NDEF_MESSAGE_NOT_FOUND = 0x81, + UFR_NDEF_UNSUPPORTED_CARD_TYPE = 0x82, + UFR_NDEF_CARD_FORMAT_ERROR = 0x83, + UFR_MAD_NOT_ENABLED = 0x84, + UFR_MAD_VERSION_NOT_SUPPORTED = 0x85, + UFR_NDEF_MESSAGE_NOT_COMPATIBLE = 0x86, + + // Tag emulation mode errors: + FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90, + + // FTDI errors: + UFR_FT_STATUS_ERROR_1 = 0xA0, + UFR_FT_STATUS_ERROR_2 = 0xA1, + UFR_FT_STATUS_ERROR_3 = 0xA2, + UFR_FT_STATUS_ERROR_4 = 0xA3, + UFR_FT_STATUS_ERROR_5 = 0xA4, + UFR_FT_STATUS_ERROR_6 = 0xA5, + UFR_FT_STATUS_ERROR_7 = 0xA6, + UFR_FT_STATUS_ERROR_8 = 0xA7, + UFR_FT_STATUS_ERROR_9 = 0xA8, + + // MIFARE PLUS error codes + UFR_MFP_COMMAND_OVERFLOW = 0xB0, + UFR_MFP_INVALID_MAC = 0xB1, + UFR_MFP_INVALID_BLOCK_NR = 0xB2, + UFR_MFP_NOT_EXIST_BLOCK_NR = 0xB3, + UFR_MFP_COND_OF_USE_ERROR = 0xB4, + UFR_MFP_LENGTH_ERROR = 0xB5, + UFR_MFP_GENERAL_MANIP_ERROR = 0xB6, + UFR_MFP_SWITCH_TO_ISO14443_4_ERROR = 0xB7, + UFR_MFP_ILLEGAL_STATUS_CODE = 0xB8, + UFR_MFP_MULTI_BLOCKS_READ = 0xB9, + + // NT4H error codes + NT4H_COMMAND_ABORTED = 0xC0, + NT4H_LENGTH_ERROR = 0xC1, + NT4H_PARAMETER_ERROR = 0xC2, + NT4H_NO_SUCH_KEY = 0xC3, + NT4H_PERMISSION_DENIED = 0xC4, + NT4H_AUTHENTICATION_DELAY = 0xC5, + NT4H_MEMORY_ERROR = 0xC6, + NT4H_INTEGRITY_ERROR = 0xC7, + NT4H_FILE_NOT_FOUND = 0xC8, + NT4H_BOUNDARY_ERROR = 0xC9, + NT4H_INVALID_MAC = 0xCA, + NT4H_NO_CHANGES = 0xCB, + + // multiple units - return from the functions with ReaderList_ prefix in name + UFR_DEVICE_WRONG_HANDLE = 0x100, + UFR_DEVICE_INDEX_OUT_OF_BOUND, + UFR_DEVICE_ALREADY_OPENED, + UFR_DEVICE_ALREADY_CLOSED, + UFR_DEVICE_IS_NOT_CONNECTED, + + // Originality Check Error Codes: + UFR_NOT_NXP_GENUINE = 0x200, + UFR_OPEN_SSL_DYNAMIC_LIB_FAILED, + UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND, + + // DESFIRE Card Status Error Codes: + READER_ERROR = 0xBB7, // 2999 [dec] + NO_CARD_DETECTED = 0xBB8, // 3000 [dec] + CARD_OPERATION_OK = 0xBB9, // 3001 [dec] + WRONG_KEY_TYPE = 0xBBA, // 3002 [dec] + KEY_AUTH_ERROR = 0xBBB, // 3003 [dec] + CARD_CRYPTO_ERROR = 0xBBC, // 3004 [dec] + READER_CARD_COMM_ERROR = 0xBBD, // 3005 [dec] + PC_READER_COMM_ERROR = 0xBBE, // 3006 [dec] + COMMIT_TRANSACTION_NO_REPLY = 0xBBF, // 3007 [dec] + COMMIT_TRANSACTION_ERROR = 0xBC0, // 3008 [dec] + NOT_SUPPORTED_KEY_TYPE = 0xBC2, // 3010 [dec] + WRONG_FILE_TYPE = 0xBC3, // 3011 [dec] + + DESFIRE_CARD_NO_CHANGES = 0x0C0C, + DESFIRE_CARD_OUT_OF_EEPROM_ERROR = 0x0C0E, + DESFIRE_CARD_ILLEGAL_COMMAND_CODE = 0x0C1C, + DESFIRE_CARD_INTEGRITY_ERROR = 0x0C1E, + DESFIRE_CARD_NO_SUCH_KEY = 0x0C40, + DESFIRE_CARD_LENGTH_ERROR = 0x0C7E, + DESFIRE_CARD_PERMISSION_DENIED = 0x0C9D, + DESFIRE_CARD_PARAMETER_ERROR = 0x0C9E, + DESFIRE_CARD_APPLICATION_NOT_FOUND = 0x0CA0, + DESFIRE_CARD_APPL_INTEGRITY_ERROR = 0x0CA1, + DESFIRE_CARD_AUTHENTICATION_ERROR = 0x0CAE, + DESFIRE_CARD_ADDITIONAL_FRAME = 0x0CAF, + DESFIRE_CARD_BOUNDARY_ERROR = 0x0CBE, + DESFIRE_CARD_PICC_INTEGRITY_ERROR = 0x0CC1, + DESFIRE_CARD_COMMAND_ABORTED = 0x0CCA, + DESFIRE_CARD_PICC_DISABLED_ERROR = 0x0CCD, + DESFIRE_CARD_COUNT_ERROR = 0x0CCE, + DESFIRE_CARD_DUPLICATE_ERROR = 0x0CDE, + DESFIRE_CARD_EEPROM_ERROR_DES = 0x0CEE, + DESFIRE_CARD_FILE_NOT_FOUND = 0x0CF0, + DESFIRE_CARD_FILE_INTEGRITY_ERROR = 0x0CF1, + DESFIRE_CATD_AUTHENTICATION_DELAY = 0X0CAD, + + // uFCoder library errors: + UFR_NOT_IMPLEMENTED = 0x1000, + UFR_COMMAND_FAILED = 0x1001, + UFR_TIMEOUT_ERR = 0x1002, + UFR_FILE_SYSTEM_ERROR = 0x1003, + UFR_FILE_SYSTEM_PATH_NOT_EXISTS = 0x1004, + UFR_FILE_NOT_EXISTS = 0x1005, + UFR_FTD2XX_DLL_NOT_FOUND = 0x1006, + + // uFCoder library/licensing specific + UFR_JSON_INVALID = 0x1012, + UFR_LICENSE_INVALID = 0x1013, + UFR_LICENSE_SAVE_FAILED = 0x1014, + UFR_LICENSE_NOT_FOUND = 0x1015, + UFR_LICENSE_HAS_EXPIRED = 0x1016, + + // SAM module error codes: + UFR_SAM_APDU_ERROR = 0x2000, + UFR_SAM_AUTH_ERROR, + UFR_SAM_CRYPTO_ERROR, + + // TLS, HTTPS Error Codes: + TLS_ERR_OPENING_SOCKET = 0x5000, + TLS_ERR_NO_SUCH_HOST = 0x5001, + TLS_CONNECTING_ERROR = 0x5002, + TLS_ERR_SERVER_UNEXPECTEDLY_CLOSED_CONNECTION = 0x5003, + TLS_ERR_UNKNOWN_GIDS_CERTIFICATE_FORMAT = 0x5004, + TLS_ERR_SET_PIN_FOR_GIDS_CERT_ONLY = 0x5005, + TLS_ERR_GIDS_PIN_CODE_WRONG = 0x5006, + TLS_ERR_UNSUPPORTED_CERTIFICATE_TYPE = 0x5007, + TLS_ERR_PRIVATE_KEY_CONTEXT_WRONG = 0x5008, + + // JC cards APDU Error Codes: + UFR_APDU_TRANSCEIVE_ERROR = 0xAE, + UFR_APDU_JC_APP_NOT_SELECTED = 0x6000, + UFR_APDU_JC_APP_BUFF_EMPTY = 0x6001, + UFR_APDU_WRONG_SELECT_RESPONSE = 0x6002, + UFR_APDU_WRONG_KEY_TYPE = 0x6003, + UFR_APDU_WRONG_KEY_SIZE = 0x6004, + UFR_APDU_WRONG_KEY_PARAMS = 0x6005, + UFR_APDU_WRONG_SIGNING_ALGORITHM = 0x6006, + UFR_APDU_PLAIN_TEXT_MAX_SIZE_EXCEEDED = 0x6007, + UFR_APDU_UNSUPPORTED_KEY_SIZE = 0x6008, + UFR_APDU_UNSUPPORTED_ALGORITHMS = 0x6009, + UFR_APDU_PKI_OBJECT_NOT_FOUND = 0x600A, + UFR_APDU_MAX_PIN_LENGTH_EXCEEDED = 0x600B, + UFR_DIGEST_LENGTH_DOES_NOT_MATCH = 0x600C, + + // reserved: 0x6100, + CRYPTO_SUBSYS_NOT_INITIALIZED = 0x6101, + CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR = 0x6102, + CRYPTO_SUBSYS_MAX_HASH_INPUT_EXCEEDED = 0x6103, + CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM = 0x6104, + CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM = 0x6105, + CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM = 0x6106, + CRYPTO_SUBSYS_WRONG_SIGNATURE = 0x6107, + CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH = 0x6108, + CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE = 0x6109, + CRYPTO_SUBSYS_HASHING_ERROR = 0x610A, + CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS = 0x610B, + CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY = 0x610C, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS = 0x610D, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY = 0x610E, + + UFR_WRONG_PEM_CERT_FORMAT = 0x61C0, + + // X.509 specific statuses: + X509_CAN_NOT_OPEN_FILE = 0x6200, + X509_WRONG_DATA = 0x6201, + X509_WRONG_LENGTH = 0x6202, + X509_UNSUPPORTED_PUBLIC_KEY_TYPE = 0x6203, + X509_UNSUPPORTED_PUBLIC_KEY_SIZE = 0x6204, + X509_UNSUPPORTED_PUBLIC_KEY_EXPONENT = 0x6205, + X509_EXTENSION_NOT_FOUND = 0x6206, + X509_WRONG_SIGNATURE = 0x6207, + X509_UNKNOWN_PUBLIC_KEY_TYPE = 0x6208, + X509_WRONG_RSA_PUBLIC_KEY_FORMAT = 0x6209, + X509_WRONG_ECC_PUBLIC_KEY_FORMAT = 0x620A, + X509_SIGNATURE_NOT_MATCH_CA_PUBLIC_KEY = 0x620B, + X509_UNSUPPORTED_SIGNATURE_SCH = 0x620C, + X509_UNSUPPORTED_ECC_CURVE = 0x620D, + + // PKCS#7 specific statuses: + PKCS7_WRONG_DATA = 0x6241, + PKCS7_UNSUPPORTED_SIGNATURE_SCHEME = 0x6242, + PKCS7_SIG_SCH_NOT_MATCH_CERT_KEY_TYPE = 0x6243, + + PKCS7_WRONG_SIGNATURE = 0x6247, + + // MRTD specific statuses: + MRTD_SECURE_CHANNEL_SESSION_FAILED = 0x6280, + MRTD_WRONG_SOD_DATA = 0x6281, + MRTD_WRONG_SOD_LENGTH = 0x6282, + MRTD_UNKNOWN_DIGEST_ALGORITHM = 0x6283, + MRTD_WARNING_DOES_NOT_CONTAINS_DS_CERT = 0x6284, + MRTD_DATA_GROUOP_INDEX_NOT_EXIST = 0x6285, + MRTD_EF_COM_WRONG_DATA = 0x6286, + MRTD_EF_DG_WRONG_DATA = 0x6287, + MRTD_EF_DG1_WRONG_LDS_VERSION_LENGTH = 0x6288, + MRTD_VERIFY_CSCA_NOT_EXIST = 0x6289, + MRTD_VERIFY_WRONG_DS_SIGNATURE = 0x628A, + MRTD_VERIFY_WRONG_CSCA_SIGNATURE = 0x628B, + MRTD_MRZ_CHECK_ERROR = 0x628C, + + // ICAO Master List specific statuses: + ICAO_ML_WRONG_FORMAT = 0x6300, + ICAO_ML_CAN_NOT_OPEN_FILE = 0x6301, + ICAO_ML_CAN_NOT_READ_FILE = 0x6302, + ICAO_ML_CERTIFICATE_NOT_FOUND = 0x6303, + ICAO_ML_WRONG_SIGNATURE = 0x6307, + + // EMV specific statuses + SYS_ERR_OUT_OF_MEMORY = 0x7001, + EMV_ERR_WRONG_INPUT_DATA = 0x7002, + EMV_ERR_MAX_TAG_LEN_BYTES_EXCEEDED = 0x7004, + EMV_ERR_TAG_NOT_FOUND = 0x7005, + EMV_ERR_TAG_WRONG_SIZE = 0x7006, + EMV_ERR_TAG_WRONG_TYPE = 0x7007, + EMV_ERR_IN_CARD_READER = 0x7008, + EMV_ERR_READING_RECORD = 0x7009, + EMV_ERR_PDOL_IS_EMPTY = 0x7010, + EMV_ERR_LIST_FORMAT_NOT_FOUND = 0x7011, + EMV_ERR_AFL_NOT_FOUND = 0x7012, + EMV_ERR_AID_NOT_FOUND = 0x7013, + + // ISO7816-4 Errors (R-APDU) - 2 SW bytes returned by the card, prefixed with 0x000A: + UFR_APDU_SW_TAG = 0x000A0000, + UFR_APDU_SW_OPERATION_IS_FAILED = 0x000A6300, + UFR_APDU_SW_WRONG_PIN_4_TRIES_REMAINING = 0x000A63C4, + UFR_APDU_SW_WRONG_PIN_3_TRIES_REMAINING = 0x000A63C3, + UFR_APDU_SW_WRONG_PIN_2_TRIES_REMAINING = 0x000A63C2, + UFR_APDU_SW_WRONG_PIN_1_TRIES_REMAINING = 0x000A63C1, + UFR_APDU_SW_WRONG_PIN_0_TRIES_REMAINING = 0x000A63C0, + UFR_APDU_SW_WRONG_LENGTH = 0x000A6700, + UFR_APDU_SW_SECURITY_STATUS_NOT_SATISFIED = 0x000A6982, + UFR_APDU_SW_AUTHENTICATION_METHOD_BLOCKED = 0x000A6983, + UFR_APDU_SW_DATA_INVALID = 0x000A6984, + UFR_APDU_SW_CONDITIONS_NOT_SATISFIED = 0x000A6985, + UFR_APDU_SW_WRONG_DATA = 0x000A6A80, + UFR_APDU_SW_FILE_NOT_FOUND = 0x000A6A82, + UFR_APDU_SW_RECORD_NOT_FOUND = 0x000A6A83, + UFR_APDU_SW_DATA_NOT_FOUND = 0x000A6A88, + UFR_APDU_SW_ENTITY_ALREADY_EXISTS = 0x000A6A89, + UFR_APDU_SW_INS_NOT_SUPPORTED = 0x000A6D00, + UFR_APDU_SW_NO_PRECISE_DIAGNOSTIC = 0x000A6F00, + + MAX_UFR_STATUS = 0x7FFFFFFF, + + UFR_DISPLAY_IMAGE_LOAD_ERROR = 0x8001, + UFR_DISPLAY_IMAGE_DIMENSION_ERROR = 0x8002, + UFR_DISPLAY_IMAGE_UNSUPPORTED_CHANNELS = 0x8003, + UFR_DISPLAY_WRITE_CMD_ERROR = 0x8004, + UFR_DISPLAY_READ_ACK_ERROR = 0x8005, + UFR_DISPLAY_WRITE_CMDEXT_ERROR = 0x8006, + UFR_DISPLAY_READ_RESPONSE_ERROR = 0x8007, + UFR_DISPLAY_TEXT_COUNT_OVERFLOW = 0x8008, + UFR_DISPLAY_INDEX_OVERFLOW = 0x8009, + UFR_DISPLAY_WRONG_SIMBOL_NUMB = 0x8010, + UFR_DISPLAY_COMMAND_FAILED = 0x8011 + +} UFR_STATUS; + +typedef enum UFCODER_SESSION_CODES +{ + UFR_SESSION_UNKNOWN_ERROR = 0x00, + UFR_SESSION_CLOSED = 0x01, + UFR_SESSION_EXPIRED = 0x02, + UFR_SESSION_DEVICE_DISCONNECTED = 0x03, + UFR_SESSION_DEVICE_FAILED_TO_CONNECT = 0x04, + + // BLE specific error codes + UFR_BLE_SESSION_ERROR_INVALID_PARAMETERS = 0x11, + UFR_BLE_SESSION_ERROR_INVALID_HANDLE = 0x12, + UFR_BLE_SESSION_ERROR_NOT_CONNECTED = 0x13, + UFR_BLE_SESSION_ERROR_OUT_OF_SPACE = 0x14, + UFR_BLE_SESSION_ERROR_OPERATION_CANCELLED = 0x15, + UFR_BLE_SESSION_ERROR_CONNECTION_TIMEOUT = 0x16, + UFR_BLE_SESSION_ERROR_UUID_NOT_ALLOWED = 0x17, + UFR_BLE_SESSION_ERROR_ALREADY_ADVERTISING = 0x18, + UFR_BLE_SESSION_ERROR_CONNECTION_LIMIT_REACHED = 0x19, + UFR_BLE_SESSION_ERROR_UNKNOWN_DEVICE = 0x20, + UFR_BLE_SESSION_ERROR_OPERATION_NOT_SUPPORTED = 0x21, + UFR_BLE_SESSION_ERROR_PEER_REMOVED_PAIRING_INFORMATION = 0x22, + UFR_BLE_SESSION_ERROR_ENCRYPTION_TIMED_OUT = 0x23, + UFR_BLE_SESSION_ERROR_TOO_MANY_LE_PAIRED_DEVICES = 0x24, + + // NFC specific error codes + + // Sesssion errors + UFR_NFC_SESSION_ERROR_FIRST_NDEF_TAG_READ = 0x30, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TERMINATED_UNEXPECTEDLY = 0x31, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TIMEOUT = 0x32, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_SYSTEM_IS_BUSY = 0x33, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_USER_CANCELED = 0x34, + + // NDEF errors + UFR_NFC_SESSION_ERROR_TAG_NOT_WRITABLE = 0x40, + UFR_NFC_SESSION_ERROR_TAG_SIZE_TOO_SMALL = 0x41, + UFR_NFC_SESSION_ERROR_TAG_UPDATE_FAILURE = 0x42, + UFR_NFC_SESSION_ERROR_ZERO_LENGTH_MESSAGE = 0x43, + + // Transceive errors + UFR_NFC_SESSION_ERROR_RETRY_EXCEEDED = 0x50, + UFR_NFC_SESSION_ERROR_TAG_CONNECTION_LOST = 0x51, + UFR_NFC_SESSION_ERROR_TAG_NOT_CONNECTED = 0x52, + UFR_NFC_SESSION_ERROR_TAG_RESPONSE_ERROR = 0x53, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_SESSION_INVALIDATED = 0x54, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_PACKET_TOO_LONG = 0x55, + + UFR_NFC_SESSION_ERROR_TAG_COMMAND_CONFIGURATION_INVALID_PARAMETERS = 0x56, + + // Other + UFR_NFC_SESSION_ERROR_UNSUPPORTED_FEATURE = 0x61, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER = 0x62, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER_LENGTH = 0x63, + UFR_NFC_SESSION_ERROR_PARAMETER_OUT_OF_BOUNDS = 0x64, + UFR_NFC_SESSION_ERROR_RADIO_DISABLED = 0x65, + UFR_NFC_SESSION_ERROR_SECURITY_VIOLATION = 0x66, + +} UFR_SESSION_STATUS; + +// DESFIRE key settings values +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE 0x09 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE 0x0F +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x01 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x08 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x0E +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x00 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x06 + +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x00 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x01 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x02 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x03 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x04 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x05 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x06 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x08 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x09 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0A +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0B +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTH_AUTH 0x0C +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTH_AUTH 0x0D +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0E +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0F + +enum E_ASYMMETRIC_KEY_TYPES +{ + RSA_PRIVATE_KEY = 0, + ECDSA_PRIVATE_KEY, + + ASYMMETRIC_KEY_TYPES_NUM +}; + +#define MAX_ECC_CURVE_NAME_LEN 30 + +enum E_ECC_CURVE_DEFINITION_TYPES +{ + ECC_CURVE_INDEX, + ECC_CURVE_NAME, + ECC_CURVE_DOMAIN_PARAMETERS, + + ECC_CURVE_DEFINITION_TYPES_NUM +}; + +enum E_SIGNATURE_SCHEMES +{ + SHA1_WITH_RSA, + SHA256_WITH_RSA, + SHA384_WITH_RSA, + SHA512_WITH_RSA, + SHA224_WITH_RSA, + SHA512_224_WITH_RSA, + SHA512_256_WITH_RSA, + + RSA_PSS, + + ECDSA_WITH_SHA1, + ECDSA_WITH_SHA256, + ECDSA_WITH_SHA384, + ECDSA_WITH_SHA512, + ECDSA_WITH_SHA224, + + SIGNATURE_SCHEMES_NUM // Don't change the order. NEVER! +}; +enum E_SIGNATURE_SCH_TYPES +{ + RSA_PKCS1, + RSA_PKCS1_PSS, + ECDSA, + + SIGNATURE_SCH_TYPES_NUM +}; +enum E_PUB_KEY_TYPES +{ + PUB_KEY_TYPE_RSA, + PUB_KEY_TYPE_ECDSA_NAMED_CURVE, + PUB_KEY_TYPE_ECDSA_DOMAIN_PARAMS, + + PUB_KEY_TYPES_NUM +}; + +enum E_BIT_ENCODINGS +{ + ENCODING_BIN, + ENCODING_HEX +}; + +enum E_CERTIFICATE_TYPES +{ + X509_PEM, + X509_DER, + X509_GIDS_NFC, + + E_CERTIFICATE_TYPES_NUM +}; + +enum E_ECC_CURVES +{ + secp112r1, + secp112r2, + secp128r1, + secp128r2, + secp160r1, + secp160r2, + secp160k1, + secp192r1, + prime192v2, + prime192v3, + secp192k1, + secp224r1, + secp224k1, + secp256r1, + secp256k1, + secp384r1, + secp521r1, + prime239v1, + prime239v2, + prime239v3, + brainpoolP160r1, + brainpoolP192r1, + brainpoolP224r1, + brainpoolP256r1, + brainpoolP320r1, + brainpoolP384r1, + brainpoolP512r1, + brainpoolP160t1, + brainpoolP192t1, + brainpoolP224t1, + brainpoolP256t1, + brainpoolP320t1, + brainpoolP384t1, + brainpoolP512t1, + + ECC_CURVES_NUM + + /* Not supported in uFCoder library yet: + sect113r1, + sect113r2, + sect131r1, + sect131r2, + sect163k1, + sect163r1, + sect163r2, + sect193r1, + sect193r2, + sect233k1, + sect233r1, + sect239k1, + sect283k1, + sect283r1, + sect409k1, + sect409r1, + sect571k1, + sect571r1 + */ +}; +// #define F2M_CURVES sect113r1 + +typedef struct +{ + uint8_t *serial; + uint8_t *subject; + uint8_t *issuer; + uint8_t *SKI; + uint8_t *AKI; + uint32_t serial_len; + uint32_t subject_len; + uint32_t issuer_len; + uint32_t SKI_len; + uint32_t AKI_len; +} icaoMlSearchCriteria_t; + +typedef struct +{ + uint32_t ecc_curve_field_type; + void *field_domain_params; // To be defined. For now only a named primary field curves are supported. +} ecc_curve_domain_params_t; + +typedef struct +{ + uint32_t ecc_curve_definition_type; // one of the E_ECC_CURVE_DEFINITION_TYPES + uint32_t ecc_curve_index; + char *ecc_curve_name; + ecc_curve_domain_params_t *ecc_curve_domain_params; +} ecc_key_param_t; + +enum E_MRTD_IMG_TYPE +{ + MRTD_IMG_JPEG = 0, + MRTD_IMG_JP2 = 1, + MRTD_IMG_JPEG2000 = 1, // Alias for the MRTD_IMG_JP2 + + MRTD_IMG_TYPE_UNKNOWN = 0xFFFFFFFF +}; + +typedef enum +{ + USER_PIN = 0, + SO_PIN, + USER_PUK, + SO_PUK +} dl_sec_code_t; + +enum E_PRINT_VERBOSE_LEVELS +{ + PRINT_NONE, + PRINT_ESSENTIALS, + PRINT_DETAILS, + PRINT_ALL_PLUS_STATUSES, +}; + +// SAM definition +typedef enum E_SAM_HW_VER +{ + SAM_UNKNOWN_TYPE, + SAM_T1AD2060_AV1_MODE, + SAM_T1AD2060_AV2_MODE, + SAM_T1AR1070_AV1_MODE, + SAM_T1AR1070_AV2_MODE +} SAM_HW_TYPE; + +// Reader status +typedef enum E_EMULATION_MODES +{ + TAG_EMU_DISABLED, + TAG_EMU_DEDICATED, + TAG_EMU_COMBINED, + TAG_EMU_AUTO_AD_HOC +} emul_modes_t; + +typedef enum E_EMULATION_STATES +{ + EMULATION_NONE, + EMULATION_IDLE, + EMULATION_AUTO_COLL, + EMULATION_ACTIVE, + EMULATION_HALT, + EMULATION_POWER_OFF +} emul_states_t; + +typedef enum E_PCD_MGR_STATES +{ + PCD_MGR_NO_RF_GENERATED, + PCD_MGR_14443A_POLLING, + PCD_MGR_14443A_SELECTED, + PCD_MGR_CE_DEDICATED, + PCD_MGR_CE_COMBO_START, + PCD_MGR_CE_COMBO, + PCD_MGR_CE_COMBO_IN_FIELD +} pcd_states_t; + +enum E_RGB_PORT_NAMES +{ + EXTERNAL_RGB_PORT, + INTERNAL_RGB_PORT +}; + +enum E_CUSTOM_UI_IDLE_MODES +{ + CUSTOM_UI_IDLE_MODE_NONE = 0, + CUSTOM_UI_IDLE_MODE_STATIC_LED, + CUSTOM_UI_IDLE_MODE_BLINKING_LED, + CUSTOM_UI_IDLE_MODES_NUMBER_INDICATOR +}; + +enum E_CUSTOM_UI_DETECTED_MODES +{ + CUSTOM_UI_DETECTED_MODE_NONE = 0, + CUSTOM_UI_DETECTED_MODE_STATIC_LED, + CUSTOM_UI_DETECTED_MODE_STATIC_LED_BEEP, + CUSTOM_UI_DETECTED_MODE_BEEP, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED_BEEP, + CUSTOM_UI_DETECTED_MODES_NUMBER_INDICATOR +}; + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup INTERNAL !!!INTERNAL!!! uFR API calls (Not for public SDK use) (remove from final revision) + * @{ + */ + /** @} */ // end of defgroup INTERNAL + + /** + * @defgroup UNDOCUMENTED UNDOCUMENTED uFR API calls (remove from final revision) + * @brief Excluded from docs due to the nature of their usage + * @{ + */ + /**@}*/ // end of defgroup INTERNAL + + /** @defgroup LibLic Library licensing + * @brief Prerequisite API calls for facilitating use of uFR MDK (Mobile Development Kit) with Android/iOS devices (usage of mobile device internal NFC antenna) + * @{ + */ + /** @} */ // end of LibLic + + /** @defgroup SingleReader Single Reader + * @{ + */ + /** @defgroup ReaderAndLibrary Reader and library + ** @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication + + /** @defgroup ReaderAndLibrary_Information Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information + + /** @defgroup ReaderAndLibrary_EEPROM EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM + + /** @defgroup ReaderAndLibrary_Signalization Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization + + /** @defgroup ReaderAndLibrary_RGBSignalization RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL. + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl Display Control + * @since uFCoder library version 6.0.5 + * + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFROnlineCommands uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands + + /** @defgroup ReaderAndLibrary_BaseHDUFR uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR + + /** @defgroup ReaderAndLibrary_NXPSAM Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM + + /** @defgroup ReaderAndLibrary_HelperFunc Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc + + /**@}*/ // end of defgroup ReaderAndLibrary + + /** @defgroup Card_Tag Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockRead(), BlockWrite(), LinearRead(), LinearWrite() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF + + /** @defgroup Card_Tag_NTAG_2XX NTAG2XX (Type 2) specific commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG + + /** @defgroup Card_Tag_NT4H NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H + + /** @defgroup Card_Tag_Mifare_Desfire Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire + + /** @defgroup Card_Tag_Mifare_Desfire_Light Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Desfire_Light + + /** @defgroup Card_Tag_Mifare_Plus Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Plus + + /** @defgroup Card_Tag_Ultralight_C Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Ultralight_C + + /** @defgroup Card_Tag_JavaCardApplication Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication + + /** @defgroup Card_Tag_CardFeatures Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4 ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4 + + /** @defgroup Card_Tag_CardFeatures_ISO7816 ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816 + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification + + /** @defgroup Card_Tag_CardFeatures_MRTD Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD + + /** @defgroup Card_Tag_CardFeatures_TLS TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS + + /** @defgroup Card_Tag_CardFeatures_EMV Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV + + /** @defgroup Card_Tag_CardFeatures_AntiCollision Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode + + /**@}*/ // end of defgroup Card_Tag_CardFeatures + + /**@}*/ // end of defgroup Card_Tag + + /** @defgroup Miscellaneous Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous + + /**@}*/ // end of defgroup SingleReader + + /** @defgroup MultiReader MultiReader + * @{ + ** @defgroup ReaderAndLibrary_ReaderList Handling multiple readers + * @brief If you want to communicate and use multiple readers from an application, you have to follow the + * initial procedure for enumerating uFR compatible devices and getting their handles + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_ReaderList + + /** @defgroup ReaderAndLibrary_M Reader and library + * @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication_M Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication_M + + /** @defgroup ReaderAndLibrary_Information_M Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information_M + + /** @defgroup ReaderAndLibrary_EEPROM_M EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM_M + + /** @defgroup ReaderAndLibrary_Signalization_M Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization_M + + /** @defgroup ReaderAndLibrary_RGBSignalization_M RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_M Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFROnlineCommands_M uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands_M + + /** @defgroup ReaderAndLibrary_BaseHDUFR_M uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR_M + + /** @defgroup ReaderAndLibrary_NXPSAM_M Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM_M + + /** @defgroup ReaderAndLibrary_HelperFunc_M Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc_M + + /**@}*/ // end of defgroup ReaderAndLibrary_M + + /** @defgroup Card_Tag_M Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General_M General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare_M Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockReadM(), BlockWriteM(), LinearReadM(), LinearWriteM() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF_M NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF_M + + /** @defgroup Card_Tag_NTAG_2XX_M NTAG2XX (Type 2) related commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG_2XX_M + + /** @defgroup Card_Tag_NT4H_M NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H_M + + /** @defgroup Card_Tag_Mifare_Desfire_M Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_M + + /** @defgroup Card_Tag_Mifare_Desfire_Light_M Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_Light_M + + /** @defgroup Card_Tag_Mifare_Plus_M Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Plus_M + + /** @defgroup Card_Tag_Ultralight_C_M Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Ultralight_C_M + + /** @defgroup Card_Tag_JavaCardApplication_M Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common_M Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common_M + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage_M DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage_M + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_M + + /** @defgroup Card_Tag_CardFeatures_M Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking_M Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking_M + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4_M ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4_M + + /** @defgroup Card_Tag_CardFeatures_ISO7816_M ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816_M + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M + + /** @defgroup Card_Tag_CardFeatures_MRTD_M Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD_M + + /** @defgroup Card_Tag_CardFeatures_TLS_M TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS_M + + /** @defgroup Card_Tag_CardFeatures_EMV_M Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV_M + + /** @defgroup Card_Tag_CardFeatures_AntiCollision_M Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision_M + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode_M Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode_M + + /**@}*/ // end of defgroup Card_Tag_CardFeatures_M + + /**@}*/ // end of defgroup Card_Tag_M + + /** @defgroup Miscellaneous_M Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous_M + + /**@}*/ // end of defgroup MultiReader + + /** @defgroup uFR_MDK uFR MDK (Mobile Development Kit) + * @since uFCoder library version 6.0.0 + * + * Using the internal NFC antenna of a mobile device is supported in the uFCoder library through the usage of ReaderOpenEx() with appropriate parameters. + * It is mandatory to obtain a valid DLogic license to make use of the uFR MDK. + * License can be obtained automatically through the ReaderOpenEx() API call. + * Or using the GetLicenseRequestData() and our online service found at: https://liblic.d-logic.com/
+ * Refer to @ref LibLic group for details. + * + * @{ + */ + /** @defgroup uFR_MDK_Android Android + * @brief uFR MDK for Android currently has support for the NTAG2XX, Mifare Classic®, Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * @{ + */ + /** @defgroup uFR_MDK_Android_NTAG2XX NTAG2XX with NDEF support + * @brief Supported API calls for NTAG2XX (e.g NTAG203/210/213/215/216) cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * read_ndef_record() + * * write_ndef_record() + * * write_ndef_record_mirroring() + * * write_ndef_record_mirroring_tt() + * * get_ndef_record_count() + * * erase_last_ndef_record() + * * erase_all_ndef_records() + * * ndef_card_initialization() + * * WriteNdefRecord_WiFi() + * * WriteNdefRecord_BT() + * * WriteNdefRecord_SMS() + * * WriteNdefRecord_Bitcoin() + * * WriteNdefRecord_GeoLocation() + * * WriteNdefRecord_NaviDestination() + * * WriteNdefRecord_Email() + * * WriteNdefRecord_Address() + * * WriteNdefRecord_AndroidApp() + * * WriteNdefRecord_Text() + * * WriteNdefRecord_StreetView() + * * WriteNdefRecord_Skype() + * * WriteNdefRecord_Whatsapp() + * * WriteNdefRecord_Viber() + * * WriteNdefRecord_Contact() + * * WriteNdefRecord_Phone() + * * ReadNdefRecord_WiFi() + * * ReadNdefRecord_Bitcoin() + * * ReadNdefRecord_GeoLocation() + * * ReadNdefRecord_NaviDestination() + * * ReadNdefRecord_Email() + * * ReadNdefRecord_Address() + * * ReadNdefRecord_AndroidApp() + * * ReadNdefRecord_Text() + * * ReadNdefRecord_StreetView() + * * ReadNdefRecord_Skype() + * * ReadNdefRecord_Whatsapp() + * * ReadNdefRecord_Viber() + * * ReadNdefRecord_Contact() + * * ReadNdefRecord_Phone() + * * ReadNdefRecord_SMS() + * * ReadNdefRecord_BT() + * * ParseNdefMessage() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_NTAG2XX + + /** @defgroup uFR_MDK_Android_Mifare Mifare Classic + * @brief Supported API calls for Mifare Classic cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * SectorTrailerWrite_PK() + * * SectorTrailerWriteUnsafe_PK() + * * ValueBlockRead_PK() + * * ValueBlockWrite_PK() + * * ValueBlockInSectorRead_PK() + * * ValueBlockInSectorWrite_PK() + * * ValueBlockIncrement_PK() + * * ValueBlockDecrement_PK() + * * ValueBlockInSectorIncrement_PK() + * * ValueBlockInSectorDecrement_PK() + * * LinearFormatCard_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Mifare + + /** @defgroup uFR_MDK_Android_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth() + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth() + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Desfire + + /** @defgroup uFR_MDK_Android_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_Android + + /** @defgroup uFR_MDK_iOS iOS + * @brief uFR MDK for IOS currently has support only for Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * + * @{ + */ + /** @defgroup uFR_MDK_iOS_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_iOS_Desfire + + + /** @defgroup uFR_MDK_IOS_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_IOS_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_iOS + + /**@}*/ // end of defgroup uFR_MDK + + //-------------------------------------------------------------------------------------------------- + /** + * @brief Used to generate license request necessary for obtaing valid uFCoder license separately. + * + * Parameter "license_request" will hold a JSON string value that is to be used for our online front-end service for generating an offline license. + * The online service is found at: https://liblic.d-logic.com/ + * + * @ingroup LibLic + * + * @param months Number of months requested for the license + * @param license_request JSON string formed with licensing parameters + * + */ + void DL_API GetLicenseRequestData(uint32_t months, OUT char *license_request); + + /** + * @brief Used to validate and store an offline Dlogic license for future usage. + * + * @ingroup LibLic + * + * @param license_str JSON string containing full license data + * + * @return Operation status + */ + UFR_STATUS DL_API SetLicenseData(c_string license_str); + + /** + * @brief Opens reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s. If you have more than one µFR Online device, ReaderOpen function will open the first one found, for the device not connected to the PC via cable, use ReaderOpenEx() instead. + *
+ * NOTE: On Android, using ReaderOpen() will establish communication with uFR Series readers connected via OTG cable. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen(void); + + /** + * @brief Opens a port of connected reader using readers family type. Useful for speed up opening for non uFR basic reader type (e.g. BaseHD with uFR support). + * + * Do not use this function for opening communication with µFR Online devices. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenByType(uint32_t reader_type); + + enum E_READER_TYPE + { + AUTO = 0, + UFR_TYPE = 1, + UFR_RS232_TYPE = 2, + BASEHD_UFR_TYPE = 3, + UFR_ONLINE_TYPE = 4, + INTERNAL_NFC = 5 + }; + + /** + * @brief Open reader communication port in several different ways. Can be used for establishing communication with COM port too. + * + * There is enumeration in uFCoder.h file called E_READER_TYPE with values: + * enum E_READER_TYPE + * { + * AUTO = 0, + * UFR_TYPE = 1, + * UFR_RS232_TYPE = 2, + * BASEHD_UFR_TYPE = 3, + * UFR_ONLINE_TYPE = 4, + * INTERNAL_NFC = 5 + * }; + * Values in this enumeration you can pass into ReaderOpenEx function as reader_type parameter.
+ * For example, if you pass 4 as reader_type it will only work with µFR Online Series devices, and then as port_name you can pass devices IP address or serial number (ex: “192.168.1.123” or “ON101390”), for port_interface you can pass ‘U’ for UDP, ‘T’ for TCP or 0. + * If you pass 0, it will automatically search for reader working mode (UDP or TCP) and open it. For argument you can pass 0 or µFR Nano device serial number to open it on 1Mbit/s (ex: “UN123456”).
+ * Using value 5 as reader_type implies usage of internal mobile device NFC. + * Upon a call to ReaderOpenEx with this parameter, the library will try to obtain license automatically via HTTP. + * On success, a valid license is stored for future use. On failure, it moves to looking up for stored licenses. Results other than UFR_OK status imply a corresponding error that occurred and as such use of internal mobile device NFC will be unavailable. + * When using 5 as reader_type, additionally you can specify port_interface parameter to decide whether to do online->offline validation or just offline. To use offline-only validation of a previously stored valid DLogic license, set port_interface to 1. + * Value 0 is default value for port_interface and implies online->offline license validation. + * More examples for port open are given in the “Reader Open Examples” document: + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-doc/blob/master/Reader_Open_Examples.pdf + * Examples: + * ReaderOpenEx(1, “COM1”, 0, 0) + * This example will open communication with µFR device attached to COM1 port on 1Mbit/s + * ReaderOpenEx(1, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR device on 1Mbit/s + * ReaderOpenEx(2, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR RS232 device on 115200 bit/s + * ReaderOpenEx(4, “ON123456”, ‘U’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on UDP protocol. + * ReaderOpenEx(4, “ON123456”, ‘T’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘U’, 0) + * This example will open communication with µFR Online reader with IP address 192.168.1.123 on UDP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘T’, 0) + * This will open communication with µFR Online reader with IP address 192.168.1.123 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, 0, 0) + * It will open communication with µFR Online reader with IP address 192.168.1.123 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, 0) + * It will open communication with µFR Online reader with serial number ON123456 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with serial number ON123456 + * ReaderOpenEx(4, “192.168.1.123”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with IP address 192.168.1.123 + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) When uFR Online reader works in BT serial mode or transparent mode, reader_type must be set to 1. + * @param port_name is c-string type used to open port by given serial name. If you provide NULL or empty string that is AUTO MODE which calls ReaderOpenEx() and all available ports on the system. serial port name, identifier, like "COM3" on Windows or "/dev/ttyS0" on Linux or "/dev/tty.serial1" on OS X or if you select FTDI, reader serial number like "UN123456", if reader have integrated FTDI interface When the UDP interface type is selected, port_name must be provided in “address:port” format. Like "192.168.1.162:8881" IP for UDP I/F + * @param port_interface type of communication interfaces (define interface which we use while connecting to the printer), supported value's: 0 : auto - first try FTDI than serial if port_name is not defined 1 : try serial / virtual COM port / interfaces 2 : try only FTDI communication interfaces 10 : try to open Digital Logic Shields with RS232 uFReader on Raspberry Pi (serial interfaces with GPIO reset) 84 ('T') : TCP/IP interface 85 ('U') : UDP interface 102 ('B'): BT serial interface. Android library only. 114 ('L'): BLE interface. Android library only. When uFR Online reader works in BT serial mode, port_interface must be set to 0 (Except Android). arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * @param arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenEx(uint32_t reader_type, IN c_string port_name, uint32_t port_interface, IN void *arg); + + /** + * @brief Opens uFR Online device by serial number. + * + * Function will open communication (UDP or TCP) with device based on its working mode. If function cannot find given serial number, it will open communication on serial port with 1Mbit/s. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param serial_number Pointer to const char array (c_string) containing devices serial number (ex. “ON101390”). + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen_uFROnline(c_string serial_number); + + /** + * @brief Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderReset(void); + + /** + * @brief Physical reset of reader communication port & tests the communication before returning a UFR_STATUS code. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetWait(void); + + /** + * @brief Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderClose(void); + + /** + * @brief This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestart(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderHwReset(void); + + /** + * @brief Used to get the FTDI D2XX driver version number. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major: Byte value indicating driver version major number + * @param version_minor: Byte value indicating driver version minor number + * @param build: Byte value indicating driver version build number + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor, VAR uint8_t* build); + + /** + * @brief Used to get the FTDI D2XX driver version number as c-string. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_str: buffer that will contain driver version as c-string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersionStr(OUT char *version_str); + + /** + * @brief Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderType(VAR uint32_t *lpulReaderType); + + /** + * @brief Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumber(VAR uint32_t *lpulSerialNumber); + + /** + * @brief Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information + * + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnected(VAR uint32_t *connected); + + /** + * @brief Store a new key or change existing key under provided index parameter. + * + * The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWrite(IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLock(IN const uint8_t *password); + + /** + * @brief Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlock(IN const uint8_t *password); + + /** + * @brief This function turns sound and light reader signals. + * + * Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignal(uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). + * + * Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolume(uint8_t sound_volume); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserData(OUT uint8_t *aucData); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExt(OUT uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 byte array containing user data + * @return Operation status + */ + UFR_STATUS DL_API WriteUserData(IN const uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 byte array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExt(IN const uint8_t *aucData); + + /** + * @brief Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). + * + * We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @ingroup Card_Tag_General + * + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardId(VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * @ingroup Miscellaneous + * + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSak(VAR uint16_t *atqa, VAR uint8_t *sak); + + /** + * @brief Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKey(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKey(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKey(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKey(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKey(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesWritten, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * The method for proving authenticity is determined by the suffix in the functions names. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKey(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKey(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKey(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKey(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKey(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKey(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKey(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. + * + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Provided Key mode (PK) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PK(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PK(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PK(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PK(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PK(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PK(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PK(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PK(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PK(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PK(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PK(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTime(VAR uint8_t *time); + + /** + * @brief Function sets the date and time into the device's RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param password pointer to the 8 bytes array containing password time pointer to the 6 bytes array containing date and time representation + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief This function is used in Common, Advance and Access Control set of functions. + * + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM. Maximal length of array is 128 bytes. + * + * Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * @param password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeSector(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeBlock(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BusAdminCardMake(uint32_t serial, IN uint8_t *password); + + /** + * @brief Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information + * + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescription(OUT uint8_t pSerialDescription[8]); + + /** + * @brief Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information + * + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumber(VAR uint8_t *build); + + /** + * @brief This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs. + * + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi-card (anti collision) mode: + //------------------------------------------------------------------------------ + /** + * @brief This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollision(void); + + /** + * @brief Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollision(void); + + /** + * @brief If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. + * + * Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCards(VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + /** + * @brief For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. + * + * First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * Before calling this function you have to call EnumCards() first. + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCards(OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + /** + * @brief Selects one of the cards which UID is on the actual UID list of the enumerated cards. + * + * If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCard(IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. + * + * Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCard(void); + + /** + * @brief Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatus(VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + //------------------------------------------------------------------------------ + /** + * @brief This function returns card type according to DlogicCardType enumeration. + * + * For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General + * + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardType(VAR uint8_t *lpucCardType); + + /** + * @brief This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General + * + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturer(OUT char* card_manufacturer_str); + + /** + * @brief This function returns 8 bytes of the T2T version. + * + * All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersion(OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). + * + * The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General + * + * @param lpulLinearSize pointer to variable which contain size of user data space lpulRawSize pointer to variable which contain size of total data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSize(VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * @ingroup Miscellaneous + * + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatus(OUT uint8_t *tt_message, VAR uint8_t *tt_status); + //------------------------------------------------------------------------------ + /** + * @brief Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. + * + * The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @ingroup Card_Tag + * + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalData(OUT uint8_t data[32], VAR uint32_t *len); + + /** + * @brief Function returns reader’s serialized discovery loop structure. + * + * C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetup(OUT uint8_t *setupStruct, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoop(IN const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Function returns the AID set in the reader to retrieve the mobile phone's unique ID. + * + * If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAid(OUT uint8_t *aid, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAid(IN const uint8_t *aid, uint32_t len); + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfig(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtp(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlot(uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKey(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencrypted(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKey(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZone(uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZone(uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatus(VAR uint8_t *bool_config_zone_locked, VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevision(uint8_t revision[4]); + //------------------------------------------------------------------------------ + + // uFCoder PRO MODE + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProMode(VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProMode(const uint32_t ReaderProMode); + + // QR barcode crypt algorithm + // initialization. with TB serial like 'TB123456' + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_Initialize(IN const uint8_t *TBSerialString, uint16_t job_number); + + // You must define 25 bytes array in memory for out_card_data[] + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCard(const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + enum CARD_ENCRYPTION_CODE_TYPE + { + CODE_TYPE_STANDARD, + CODE_TYPE_GROUP, + CODE_TYPE_DAILY_RANGE, // valid from, but only to_timestamp / every day + }; + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNext(const uint32_t code_type, const uint32_t from_timestamp, const uint32_t to_timestamp, + const uint32_t additional_data_size, IN const uint8_t additional_data[], + VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSN(OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSN(VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSN(OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Function returns TNF, type of record, ID and payload from the NDEF record. + * + * NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_record(uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. + * + * Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, IN uint8_t *id, + IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, VAR uint8_t *card_formated); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_tt(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, + int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. + * + * Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_count(VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, OUT uint8_t *ndef_record_array, + VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_record(uint8_t message_nr); + + /** + * @brief Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_records(uint8_t message_nr); + + /** + * @brief Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. + * + * If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initialization(void); + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + /** + * @brief Function stores a message record for NTAG emulation mode into the reader. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdef(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief This function does the same as WriteEmulationNdef() function with the addition of an AAR embedded in to the NDEF message. + * + * AAR stands for “Android Application Record”. AAR is a special type of NDEF record that is used by Google’s Android operating system to signify to an NFC phone that an explicitly defined Android Application which should be used to handle an emulated NFC tag. Android App record will be added as the 2nd NDEF record in the NDEF message. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record type_record pointer to the array containing record type type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param type_record pointer to the array containing record type + * @param type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param id pointer to the array containing record ID + * @param id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param aar pointer to the array containing AAR record + * @param aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefWithAAR(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length, IN uint8_t *aar, uint8_t aar_length); + + /** + * @brief Put the reader permanently in a NDEF tag emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStart(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStop(void); + + /** + * @brief Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStart(void); + + /** + * @brief Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). + * + * uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStart(void); + + /** + * @brief Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStop(void); + + /** + * @brief This function returns current ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParams(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief This command set ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 CombinedModeEmulationStart Function description Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. Function declaration (C language) UFR_STATUS CombinedModeEmulationStart(void); Function takes no parameters. ________________ Support for ISO14443-4 protocol + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParams(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param is_field_present value representing whehter field is present (1) or not (0) + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldState(VAR uint8_t *is_field_present); + + /** + * @brief Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommMode(void); + + /** + * @brief The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommMode(void); + + /** + * @brief Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRam(IN uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data buffer containing ram data returned + * @param addr address from which to read reader RAM + * @param data_len length of data to read from RAM + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRam(OUT uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function stores a message record for NTAG emulation mode into the reader in the RAM. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRam(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, + IN uint8_t *id, uint8_t id_length, IN uint8_t *payload, uint32_t payload_length); + + /** + * @brief Put the reader permanently in a NDEF tag in RAM emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStopRam() function), or by reader reset. Use the function GetReaderStatus to check if the reader is still in emulation mode (maybe the reader was reset for some reason). + * From library version 5.0.31, and firmware version 5.0.31 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartRam(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopRam(void); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value sets to 0. + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value stays unchangeable. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterNonResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function disables the NFC counter in the card emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterDisabled(void); + + //------------------------------------------------------------------------------ + + // GetNfcT2TVersion() returns 8 bytes (see T2T documentation): + typedef struct t2t_version_struct + { + uint8_t header; + uint8_t vendor_id; + uint8_t product_type; + uint8_t product_subtype; + uint8_t major_product_version; + uint8_t minor_product_version; + uint8_t storage_size; + uint8_t protocol_type; + } t2t_version_t; + + // NfcT2TSafeConvertVersion() returns converts version_record that returned from GetNfcT2TVersion() + // or GetNfcT2TVersionM(). Conversion is "alignment safe" + // (you don't need to pay attention on structure byte alignment): + /** + * @brief This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion(). + * + * All modern T2T chips having same or very similar structure of the T2T version data represented in the uFR API by the structure type t2t_version_t: + * typedef struct t2t_version_struct { + * uint8_t header; + * uint8_t vendor_id; + * uint8_t product_type; + * uint8_t product_subtype; + * uint8_t major_product_version; + * uint8_t minor_product_version; + * uint8_t storage_size; + * uint8_t protocol_type; + * } t2t_version_t; + * This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). Conversion done by this function is "alignment safe". + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param version pointer to the structure of the t2t_version_t type which will receive converted T2T version + * @param version_record pointer to array containing 8 bytes of the raw T2T version acquired using function GetNfcT2TVersion() + * + */ + void DL_API NfcT2TSafeConvertVersion(t2t_version_t *version, const uint8_t *version_record); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignature(OUT uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], VAR uint8_t *lpucUidLen, + VAR uint8_t *lpucDlogicCardType); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExt(OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + /** + * @brief This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounter(uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounter(uint8_t counter_address, uint32_t inc_value); + + /** + * @brief This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. + * + * If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounter(VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK(VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK(VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfig(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigEx(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfig(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigEx(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only. Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode idle mode value + * @param card_detection_mode card detection mode value + * @param idle_color idle color value(RGB) + * @param card_detection_color card detection color value(RGB) + * @param enabled enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfig(uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only. Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode pointer to idle mode value + * @param card_detection_mode pointer to card detection mode value + * @param idle_color pointer to idle color value(RGB) + * @param card_detection_color pointer to card detection color value(RGB) + * @param enabled pointer to enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfig(uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_number(VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, uint8_t start_hour, + uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record(uint8_t record_number, VAR uint16_t *first_reader_nr, VAR uint16_t *last_reader_nr, + VAR uint8_t *start_hour, VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_record(uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_record(uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, uint8_t begin_hour, + uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, uint8_t end_hour, + uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_record(VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, VAR uint8_t *end_month, + VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_type(uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_type(VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_duration(uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_duration(VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_duration(uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_duration(VAR uint32_t *duration); + + // swimming pool ************************************************************** + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validity(VAR int32_t *credit, VAR uint32_t *begin_year, VAR uint32_t *begin_month, + VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, + VAR uint32_t *end_year, VAR uint32_t *end_month, VAR uint32_t *end_day, + VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validity(int32_t credit, uint32_t begin_year, uint32_t begin_month, uint32_t begin_day, + uint32_t begin_hour, + uint32_t begin_minute, + uint32_t end_year, uint32_t end_month, uint32_t end_day, uint32_t end_hour, + uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_record(uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_record(uint8_t record_number, VAR uint8_t *right_record_type, OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counter(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, + uint8_t end_minute, IN uint8_t *days, uint8_t max_daily_counter); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record_type_max_daily_counter(uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, + VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days, VAR uint8_t *max_daily_counter); + + //============================================================================= + + /** + * @brief Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOn(uint16_t pulse_duration); + + /** + * @brief Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayState(uint8_t state); + + /** + * @brief Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param intercom shows that there is voltage at the terminals for intercom connection, or notss + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoState(VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControl(uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Function gets the state of the input pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param input_nr ordinal number of hardware specific input pin input_state input state 1 or 0. + * @param input_state input state 1 or 0. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetInputState(uint8_t input_nr, VAR uint8_t *input_state); + + /** + * @brief This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControl(uint8_t light_status); + + /** + * @brief For classic uFR PLUS devices only. The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. + * + * This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControl(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Sets the color of the RGB diodes. + * + * This color stays on the RGB diodes until the function GreenLedBlinkingTurnOn() is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity(). + * Before this function call, the function GreenLedBlinkingTurnOff() must be called, or the reader is already in mode of blocking automatic signalization. + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControl(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControl(uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes. + * + * This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleep(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. + * + * In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. + * Function also sets the number of omitted activity periods, when the RGB light is off. + * For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriod(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSet(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefault(void); + + /** + * @brief The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. + * + * Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMax(uint8_t bad_select_nr_max); + + /** + * @brief The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMax(VAR uint8_t *bad_select_nr_max); + + /** + * @brief Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepMode(void); + + /** + * @brief Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepMode(void); + + /** + * @brief Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSet(uint8_t seconds_wait); + + /** + * @brief Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGet(VAR uint8_t *seconds_wait); + + /** + * @brief This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanently(unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParameters(VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. + * + * Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. + * The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. + * For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayData(IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Function has the same functionality as the function SetDisplayData(). New feature is the RGB port selection. + * + * Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbData(IN uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequency(uint16_t frequency); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * SetRgbIntensity()(alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * GetRgbIntensity (alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensity(VAR uint8_t *intensity); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRgbIntensity(VAR uint8_t *intensity); + // DESFIRE functions ************************************************************** + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode(void); + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATS(OUT uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorage(void); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceive(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint32_t *ufr_status); + + /** + * @brief Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Transceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, uint8_t data_out_len, + OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, uint8_t send_le, + OUT uint8_t *apdu_status); + + /** + * @brief Sends C–APDU in the c_string (zero terminated) format, containing pairs of the hexadecimal digits. + * + * Pairs of the hexadecimal digits can be delimited by any of the punctuation characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu C-APDU hexadecimal c_string + * @param r_apdu Received R-APDU as a hexadecimal c_string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceive(IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are sent and receive in the form of the byte arrays. + * + * There is obvious need for a c_apdu_len and *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceive(IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @param c_apdu array containing C_APDU + * @param c_apdu_len length of C_APDU + * @param r_apdu buffer that will store R_APDU + * @param r_apdu_len returns length of R_APDU + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeap(IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief This is “exploded binary” alternative function intended for support APDU commands in ISO 14443-4A tags. + * APDUTransceive() receives separated parameters which are an integral part of the C– APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls cls + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, uint32_t Nc, + OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chain(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint8_t *rcv_chained, + VAR uint32_t *ufr_status); + + /** + * @brief R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceive(uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselect(uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * @ingroup UNDOCUMENTED + * + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive(uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, uint8_t crypto1, + uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Function sets the parameters for transceive mode. + * + * If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_start(uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stop(void); + + /** + * @brief Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enable(void); + + /** + * @brief The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending rcv_data pointer to data array received from card bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceive(IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, uint32_t bytes_to_receive, + VAR uint32_t *rcv_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interface(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_Generic(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interface(void); + + /** + * @brief Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDU(void); + + /** + * @brief Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4(void); + + /** + * @brief Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interface(void); + + /** + * @brief APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interface(void); + + //============================================================================== + /** + * @brief Using this function you can select the appropriate application on the card. + * + * For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAid(IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief In JCApp cards you can put two types of asymmetric crypto keys. + * + * Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKey(uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + IN const uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPair(uint8_t key_type, uint8_t key_index, uint8_t key_designator, uint16_t key_bit_len, + IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPair(uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPair(uint8_t key_index); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBegin(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *chunk, + uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdate(IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEnd(VAR uint16_t *sig_len); + + /** + * @brief This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignature(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *plain_data, + uint16_t plain_data_len, VAR uint16_t *sig_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Finally, to get a signature, you have to call JCAppGetSignature(). + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior calling of this function you have to be logged in with an User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig Pointer to an array of “sig_len” bytes length. Value of the “sig_len” you've got as a parameter of the JCAppSignatureEnd() or JCAppGenerateSignature() functions. You have to allocate those bytes before calling this function. + * @param sig_len Length of the allocated bytes in a sig array. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetSignature(OUT uint8_t *sig, uint16_t sig_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObj(uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, uint8_t id_size); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubject(uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Using this function you can delete certificate objects from a card. + * + * This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCert(uint8_t obj_type, uint8_t obj_index); + + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjId(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubject(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObj(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + /** + * + * @ingroup Card_Tag_JavaCardApplication + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + c_string DL_API JCAppGetErrorDescription(UFR_STATUS apdu_error_status); + + /** + * @brief This function is used to login to the JCApp with an appropriate PIN code. + * + * Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. JCAppGetPinTriesRemaining Function description This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. This function have parameter of the type dl_sec_code_t which is defined as: typedef enum { USER_PIN = 0, SO_PIN, USER_PUK, SO_PUK } dl_sec_code_t; + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLogin(uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemaining(dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t. + * + * Which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code. + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChange(dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief This function is used to unblock PIN code which is specified by the SO parameter. + * + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblock(uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKey(uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, OUT uint8_t *exponent, + VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKey( + uint8_t key_index, OUT uint8_t *keyW, + VAR uint16_t *keyWSize, + OUT uint8_t *field, VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, VAR uint16_t *g_size, + OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBits(uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + //------------------------------------------------------------------------------ + /** + * @brief This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. + * + * Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list_size ointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSize(VAR uint32_t *list_size); + + /** + * @brief After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFiles(OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief This function returns file size indexed by the parameter card_file_index, on successful execution. + * + * Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file which size we want to get. + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSize(uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFile(uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief This function reads a file from the DLStorage card directly to the new file on the host file-system. + * + * If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. + * + * Parameter data_size defines the amount of data to be written in the file on the DLStorage card. + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFile(uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief This function writes file content from the host file-system to the new file on the DLStorage card. + * + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief After successful call to this function, the file on the DLStorage card will be deleted. + * + * Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFile(uint8_t file_index); + //------------------------------------------------------------------------------ + /** + * @brief This function is used to get hash output length in bytes for specified hash algorithms. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator for which we want to get output length in bytes. Use values declared in E_HASH_ALGS enumeration. + * @param out_byte_len After successful function execution, the variable on which this pointer points to, will contain output hash length in bytes for specified hash algorithm. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashOutputByteLength(uint32_t hash_algo, VAR uint32_t *out_byte_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions) + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHash(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, OUT uint8_t *hash, uint32_t hash_alocated); + + /** + * @brief This function calculates and returns the hash of the data in the buffer pointed by the “in” function parameter. + * + * Hash algorithm is specified by the hash_algo function parameter. + * If output bytes don't match with hash_alocated function parameter function returns CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH status. + * GetHashToHeap() automatically allocates memory, which *hash parameter will point to after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used for calculation. Use values declared in E_HASH_ALGS enumeration. + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions). + * @param hash After successful function execution, the variable on which this pointer points to, will contain the pointer to the output hash. + * @param hash_len After successful function execution, the variable on which this pointer points to, will contain output hash length. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashToHeap(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, VAR uint8_t **hash, VAR uint32_t *hash_len); + + /** + * @brief This function is used in conjunction with DLHashUpdateChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() has to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used in the following hashing sequence. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashInitChunked(uint32_t hash_algo); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param in One of the chunks of data of which hash is calculated. + * @param in_len Chunk length in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashUpdateChunked(IN const uint8_t *in, uint32_t in_len); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunked(OUT uint8_t *hash, uint32_t hash_alocated); + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * DLHashFinishChunkedToHeap() automatically allocates memory, which *hash parameter will point to, after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunkedToHeap(OUT uint8_t **hash, VAR uint32_t *hash_alocated); + + /** + * @brief This function is used to verify the digital signature of the pre-hashed value or some relatively short plain text message. + * + * If there is no errors during the verification process and digital signature correspond to the "To Be Signed" (TBS) data array and public cryptographic key, the function returns UFR_OK status. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * In case of wrong digital signature, function returns CRYPTO_SUBSYS_WRONG_SIGNATURE status. + * Function can return following status codes in case of various errors: + * * CRYPTO_SUBSYS_NOT_INITIALIZED + * * CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS + * * CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS + * * CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE + * * CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR + * For digest_alg use one of the values declared in E_SIGNER_DIGESTS enumeration: + * enum E_SIGNER_DIGESTS { + * ALG_NULL = 0, + * ALG_SHA, + * ALG_SHA_256, + * ALG_SHA_384, + * ALG_SHA_512, + * ALG_SHA_224, + * ALG_SHA_512_224, + * ALG_SHA_512_256, + * SIG_DIGEST_MAX_SUPPORTED + * }; + * ALG_SHA is the designator for the SHA-1 algorithm. + * For padding_alg use one of the values declared in E_SIGNER_RSA_PADDINGS enumeration: + * enum E_SIGNER_RSA_PADDINGS { + * PAD_NULL = 0, + * PAD_PKCS1_V1_5, + * PAD_PKCS1_PSS, + * SIG_PAD_MAX_SUPPORTED + * }; + * PAD_PKCS1 is an alias of the PAD_PKCS1_V1_5 padding algorithm: + * #define PAD_PKCS1 PAD_PKCS1_V1_5 + * For cipher_alg use one of the values declared in E_SIGNER_CIPHERS enumeration: + * enum E_SIGNER_CIPHERS { + * SIG_CIPHER_RSA = 0, + * SIG_CIPHER_ECDSA, + * SIG_CIPHER_MAX_SUPPORTED + * }; + * When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * + * @ingroup Card_Tag_CardFeatures_DigitalSignatureVerification + * + * @param digest_alg in the E_SIGNER_DIGESTS enumeration. + * @param padding_alg in the E_SIGNER_RSA_PADDINGS enumeration. When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * @param cypher_alg in the E_SIGNER_CIPHERS enumeration. tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * @param tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param signature Pointer to the signature array. + * @param signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. + * @param sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). + * @param pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. + * @param pub_key_params_len Length of the additional public key parameters (in bytes). + * + * @return Operation status + */ + UFR_STATUS DL_API DigitalSignatureVerifyHash(uint32_t digest_alg, uint32_t padding_alg, uint32_t cypher_alg, IN const uint8_t *tbs, + uint32_t tbs_len, IN const uint8_t *signature, uint32_t signature_len, + IN const void *sig_params, uint32_t sig_params_len, IN const uint8_t *pub_key, + uint32_t pub_key_len, IN const void *pub_key_params, uint32_t pub_key_params_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetHashName(uint32_t hash_algo); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the ECC curve designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param eccCurve ECC curve designator. Use values declared in E_ECC_CURVES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetEccCurveName(uint32_t eccCurve); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the signature scheme (signature algorithm) designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param signatureScheme Signature scheme (signature algorithm) designator. Use values declared in E_SIGNATURE_SCHEMES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetSignatureSchemeName(uint32_t signatureScheme); + + /** + * @brief Release the memory allocated from some of the library functions previously called making it available again for further allocations. + * + * Use to deallocate i.e. cleanup memory on the heap allocated. This function is a so-called helper for programming languages other than C/C++ where you can use a free(ptr) instead. Use only after calling the library functions for which it is explicitly indicated in this manual. Function returns nothing. After successful function execution ptr will point to NULL. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param ptr Pointer to the memory allocated on the heap which you want to release. If ptr does not point to a block of memory allocated with the library functions, it causes undefined behavior. If ptr is NULL, the function does nothing. Digital signature verification Enumerations, types and structures for use with DigitalSignatureVerifyHash function enum E_ECC_CURVE_DEFINITION_TYPES { ECC_CURVE_INDEX, ECC_CURVE_NAME, ECC_CURVE_DOMAIN_PARAMETERS, ECC_CURVE_DEFINITION_TYPES_NUM }; + * + */ + void DL_API DLFree(void *ptr); + //------------------------------------------------------------------------------ + /** + * @brief Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBac(IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], + VAR uint64_t *send_sequence_cnt); + + /** + * @brief Use this function to read files from the eMRTD NFC tag. + * + * You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param file_index Parameter that specifies the file we want to read from the eMRTD. This is a pointer to byte array containing exactly two bytes designating eMRTD file. Those two bytes are file identificator (FID) and there is a list of FIDs: EF.COM = {0x01, 0x1E} EF.DG1 = {0x01, 0x01} EF.DG2 = {0x01, 0x02} EF.DG3 = {0x01, 0x03} EF.DG4 = {0x01, 0x04} EF.DG5 = {0x01, 0x05} EF.DG6 = {0x01, 0x06} EF.DG7 = {0x01, 0x07} EF.DG8 = {0x01, 0x08} EF.DG9 = {0x01, 0x09} EF.DG10 = {0x01, 0x0A} EF.DG11 = {0x01, 0x0B} EF.DG12 = {0x01, 0x0C} EF.DG13 = {0x01, 0x0D} EF.DG14 = {0x01, 0x0E} EF.DG15 = {0x01, 0x0F} EF.DG16 = {0x01, 0x10} EF.SOD = {0x01, 0x1D} + * @param output After the successful call to this function, this pointer will point to the pointer on the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated during function execution. Maximum amount of data allocated can be 32KB. There is a programmer responsibility to cleanup allocated data (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * @param output_length After the successful call to this function, this pointer is pointed to the size of the file data read from an eMRTD file specified by the file_index parameter. + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeap(IN const uint8_t file_index[2], VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief This function validates data groups read from the eMRTDocument. + * + * All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function.\ + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidate(IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, uint32_t verbose_level, + OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, you can call this function and pass it null terminated strings containing document number, document holder date of birth and document expiration date. + * + * After successful function execution MRZ Proto Key will be stored in a mrz_proto_key 25-byte array. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param doc_number Pointer to a null terminated string containing exactly 9 characters document number. + * @param date_of_birth Pointer to a null terminated string containing exactly 6 characters representing the date of birth in the “YYMMDD” format. + * @param date_of_expiry Pointer to a null terminated string containing exactly 6 characters representing expiration date in the “YYMMDD” format. + * @param mrz_proto_key This byte array will contain a calculated MRZ proto-key after successful function execution. This array must have allocated at least 25 bytes prior to calling this function. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTD_MRZDataToMRZProtoKey(IN const char *doc_number, IN const char *date_of_birth, IN const char *date_of_expiry, + OUT uint8_t mrz_proto_key[25]); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, in the case of the TD3 MRZ format (88 totally character long), you can call this function and pass it a null terminated string containing the MRZ subjacent row. + * + * Example of the TD3 MRZ format printed on the eMRTD document looks like this: + * P File 2, and overwrites the contents with data provided + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param data Array containing NDEF message data stored in a buffer to be written + * @param data_length length of the data to be written + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFMessage(IN uint8_t *data, uint32_t data_length); + + /** + * @brief Function used to read the whole NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param message pointer to array that will hold message data + * @param message_length length of the message that was read if successfull + * + * @return Operation status + */ + + UFR_STATUS DL_API uFR_int_DesfireReadNDEFMessage(OUT uint8_t* message, uint32_t *message_length); + /** + * @brief Function used to extract the payload of the NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param payload_str pointer to buffer that will hold payload data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadNDEFPayload(OUT char* payload_str); + + /** + * @brief Function used to write the payload of the NDEF message on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * The function takes in only c-string URI, and sets it's uri_identifier to 0 so it is not prefixed by anything when read. + * + * @param payload_str pointer to buffer that will hold message data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFPayload(IN c_string payload_str); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief The function allows the blinking of the green diode independently of the user's signaling command (default setting). + * + * This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOn(void); + + /** + * @brief The function prohibits the blinking of the green diode independently of the user's signaling command. + * + * LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOff(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOn(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOff(void); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeA(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeB(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212Default(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424Default(void); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeA(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeB(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t CWGsNOff, + uint8_t ModGsNOff); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API FastFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParameters(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrate(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersPN7462(OUT uint8_t *die_id, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, VAR uint8_t *fw_ver_build); + + // SAM + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_raw(OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version(VAR SAM_HW_TYPE *sam_type, OUT uint8_t *sam_uid); + + /** + * @brief Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_raw(uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param key_no key_no + * @param key_v key_v + * @param des_key des_key + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_des(uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * @ingroup UNDOCUMENTED + * + * @param aes_key_ver_a aes_key_ver_a + * @param ver_a ver_a + * @param aes_key_ver_b aes_key_ver_b + * @param ver_b ver_b + * @param aes_key_ver_c aes_key_ver_c + * @param ver_c ver_c + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_key(IN uint8_t *aes_key_ver_a, uint8_t ver_a, IN uint8_t *aes_key_ver_b, + uint8_t ver_b, IN uint8_t *aes_key_ver_c, uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param master_aes_key master_aes_key + * @param key_version key_version + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_mode(IN uint8_t *master_aes_key, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. + * + * A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plain(IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *keyA, IN uint8_t *keyB, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Ultralight C card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 8 bytes of DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_key(uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + uint8_t sam_lock_unlock, uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKey(uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeable(void); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfReset(void); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOn(void); + + /** + * @brief Function switch off RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderId(IN uint8_t *reader_id); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReader(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderUsb(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderStreamUsb(IN uint8_t *data, uint16_t packet_nr); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BootReader(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_CodeProtect(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParams(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParamsUsb(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_Test(uint8_t param); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdCalibration(uint8_t lpcd_threshold, OUT uint16_t *lpcd_reference); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdPerform(uint8_t lpcd_threshold, uint16_t lpcd_reference, VAR uint16_t *lpcd_agc, VAR uint8_t *lpcd_status); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOn(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ExtField(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ESP32_boot_init(IN uint8_t *reader_cnt, uint8_t reader_nr); + + // MIFARE PLUS + /** + * @brief Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePerso(uint16_t address, IN uint8_t *data); + + /** + * @brief Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPerso(void); + + /** + * @brief Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param card_master_key card_master_key + * @param card_config_key card_config_key + * @param level_2_switch_key level_2_switch_key + * @param level_3_switch_key level_3_switch_key + * @param level_1_auth_key level_1_auth_key + * @param select_vc_key select_vc_key + * @param prox_chk_key prox_chk_key + * @param vc_poll_enc_key vc_poll_enc_key + * @param vc_poll_mac_key vc_poll_mac_key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimal(IN uint8_t *card_master_key, IN uint8_t *card_config_key, IN uint8_t *level_2_switch_key, + IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, IN uint8_t *select_vc_key, + IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key); + + /** + * @brief Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current master key *new key pointer to 16 byte array containing the new master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new master key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new configuration key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) *configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PK(IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKey(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Key B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key_index new_key_index + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index, uint8_t new_key_type); + + /** + * @brief + * ADD DESCRIPTION + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param old_key old_key + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * @brief Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKey(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PK(IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key_index pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief + * Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PK(IN uint8_t *key); + + /** + * @brief No authentication. Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_auth(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_key(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key(IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceGet(uint32_t auth_mode, IN void *auth_value, VAR int32_t *credit); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceSet(uint32_t auth_mode, IN void *auth_value, int32_t credit); + + /** + * @brief This function sets communication speed (UART baud rate). + * + * Allowed values of baud rate are: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, and 1000000 bps. All RS232 devices are supported, and USB devices (Nano FR, Classic) from firmware version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param baud_rate UART baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API SetUartSpeed(uint32_t baud_rate); + + /** + * @brief This function returns communication speed (UART baud rate) to default value. + * + * For RS23 devices default communication speed is 115200 bps, and for USB devices is 1000000 bps. + * For RS232 devices from version 5.0.1 (plus devices), and for USB devices from version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 1 - USB 2 - RS232 + * @param comm_type 1 - COM port 2 - FTDI + * @param port_name If comm_type is FTDI enter empty string If comm_type is COM port Windows “COMx” Linux “/dev/ttyUSBx” Mac OS “/dev/tty.usbserial-xxxxxxxx” + * + * @return Operation status + */ + UFR_STATUS DL_API SetDefaultUartSpeed(uint8_t reader_type, uint8_t comm_type, IN c_string port_name); + + // NT4H + /** + * @brief Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. + * + * This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parameters(uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Provided Key mode (PK) The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit read_ctr_limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Provided Key mode (PK) Function enables card Random ID. + * + * Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pk(IN uint8_t *aes_key_ext); + UFR_STATUS DL_API nt4h_unset_rid_pk(IN uint8_t *aes_key_ext); + + /** + * @brief Function enables card Random ID. Authentication with application master key (key number 0) required. + * + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid(uint8_t aes_key_no); + + /** + * @brief Provided Key mode (PK) Function returns card UID if Random ID activated. + * + * Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid(uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Provided Key mode (PK) Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pk(IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key(uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Provided Key mode (PK) Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pk(IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr(uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief No authentication. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_auth(uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Helper function for the MAC of SDM checking. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param mac_in_data data from mac_input_offset to mac_offset + * @param mac_in_len mac_input_offset - mac_offset + * @param sdm_mac pointer to array contained 8 bytes SDM MAC + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_check_sdm_mac(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *mac_in_data, IN uint8_t mac_in_len, IN uint8_t *sdm_mac); + + /** + * @brief Helper function for decryption of encrypted file data. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param enc_file_data pointer to array contained encrypted part of file data + * @param enc_file_data_len length of encrypted part of file data + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_sdm_enc_file_data(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *enc_file_data, IN uint8_t enc_file_data_len); + + /** + * @brief Helper function for decryption of encrypted PICC data. + * + * Function returns UID and SDM reading counter. Users need to know the AES key for metadata read (PICC data). + * + * @ingroup Card_Tag_NT4H + * + * @param picc_data pointer to array contained encrypted PICC data + * @param auth_key pointer to array contained AES meta data read key + * @param picc_data_tag if bit 7 set exist UID mirroring if bit 6 set exist SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param smd_read_cnt pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_picc_data(IN uint8_t *picc_data, IN uint8_t *auth_key, IN uint8_t *picc_data_tag, IN uint8_t *uid, IN uint32_t *smd_read_cnt); + + /** + * Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature(uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pk(IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status(uint8_t aes_key_no, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_auth(VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pk(IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt(uint8_t aes_key_no, uint8_t tt_status_key_no); + + // Desfire light + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param file_type file type 0 - standard data file, 2 - value file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param free_get_value value file get value without authentication (0 - disabled, 1 - enabled) + * @param record_size cyclic record file size of record + * @param max_number_of_rec cyclic record file maximal number of record + * @param curr_number_of_rec cyclic record file number of used record + * @param ex_unauth_operation TMC file exclude unauthorized operation + * @param tmc_limit_conf TMC file limit configuration + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param tmc_limit TMC file counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, VAR uint8_t *free_get_value, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *ex_unauth_operation, VAR uint8_t *tmc_limit_conf, VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, VAR uint32_t *tmc_limit); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered read_key_no read key number (0 - 4) write_key_no write key number (0 - 4) read_write_key_no read write key number (0 - 4) change_key_no change key number (0 - 4) + * @param key_no DESCRIPTION + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no currnent change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Function changes file settings of the Transaction MAC file. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no aes_key_no + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * @ingroup UNDOCUMENTED + * + * @param aes_key_ext aes_key_ext + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * @brief + * From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pk(IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file(uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in credit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of credit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_credit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in debit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of debit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_debit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in clear record operation. Function also returns decrypted Previous Reader ID. Users must enter file number, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_clear_record_transaction_mac(uint8_t file_no, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + // reader + /** + * @brief Function returns various reader states. + * + * From library version 5.0.31 and firmware version 5.0.33 + * The reader states are defined into following structures. This function is useful for checking if the reader is still in emulation mode after calling the TagEmulationStartRam() function. + * typedef enum E_EMULATION_MODES { + * TAG_EMU_DISABLED, + * TAG_EMU_DEDICATED, + * TAG_EMU_COMBINED, + * TAG_EMU_AUTO_AD_HOC + * }emul_modes_t; + * typedef enum E_EMULATION_STATES + * { + * EMULATION_NONE, + * EMULATION_IDLE, + * EMULATION_AUTO_COLL, + * EMULATION_ACTIVE, + * EMULATION_HALT, + * EMULATION_POWER_OFF + * }emul_states_t; + * typedef enum E_PCD_MGR_STATES + * { + * PCD_MGR_NO_RF_GENERATED, + * PCD_MGR_14443A_POLLING, + * PCD_MGR_14443A_SELECTED, + * PCD_MGR_CE_DEDICATED, + * PCD_MGR_CE_COMBO_START, + * PCD_MGR_CE_COMBO, + * PCD_MGR_CE_COMBO_IN_FIELD + * }pcd_states_t; + * + * @ingroup Miscellaneous + * + * @param state - normal working mode states are PCD_MGR_NO_RF_GENERATED or PCD_MGR_14443A_POLLING or PCD_MGR_14443A_SELECTED. - NTAG emulation mode state is PCD_MGR_CE_DEDICATED emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderStatus(VAR pcd_states_t *state, VAR emul_modes_t *emul_mode, VAR emul_states_t *emul_state, VAR uint8_t *sleep_mode); + + // EMV FUNCTIONS + + /** + * @brief Used for extracting the credit card PAN number. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param pan_str Pointer to char array containing credit card PAN. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetPAN(IN c_string df_name, OUT char *pan_str); + + /** + * @brief Used for extracting details about the last transaction stored in a credit card. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param last_transaction_info Pointer to char array containing details about the last transaction stored in the card. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetLastTransaction(IN c_string df_name, OUT char *last_transaction_info); + + + /** + * @brief Function is used for extracting image pixel values and storing them in the display for later use. This function will not render the image to the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param gallery_index - where in displays memory to store the bitmap(0-10) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveBitmapToGallery(const char* filename, int gallery_index); + + /** + * @brief Function takes an image and extracts it's pixel values and then just renders the on the display without storing the bitmap in the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param timeout - how long the bitmap should stay on display, 0-is indefinitely + * @param positionX - where on the display to start the bitmap. + * @param positionY - where on the display to start the bitmap. + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmap(const char* filename, uint32_t timeout, int positionX, int positionY); + + /** + * @brief Function renders an image that is stored in the display gallery. The gallery consist of 15 slots, of those 15 - 10 are used for storing bitmaps and the other 4 (11-15) are SystemBitmaps used by the display. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param gallery_index - which slot from the gallery to render on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmapFromGallery(int gallery_index); + + /** + * @brief Function allows you to change the essential symbols that the display regularly uses. These symbols include the Boot Image (ID-15), the Check bitmap(ID-14), and the Cross bitmap (ID-13). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param system_bitmap_index - ID of which system bitmap to change or import new (if slot is free 11-12) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveSystemBitmap(const char* filename, int system_bitmap_index); + + /** + * @brief Function renders the last image that was called with the function Display_ShowBitmap() + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowLastUnsavedImage(); + + /** + * @brief Function is used for communicating with the uFR device via I2C in COM protocol format. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param cmd - Command packet (read the "COM protocol" for more information) + * @param cmd_ext - Command extended packet, if cmd_ext is not being sent then should be "NULL" + * @param rsp - Array where the response will be written (at least 7 bytes) + * @return Operation status + */ + UFR_STATUS DL_API Display_Transmit(uint8_t *cmd, uint8_t *cmd_ext, uint8_t *rsp); + + /** + * @brief Function displays custom text on the screen. It can also enable text scrolling, position the text at a specific location on the display, and adjust the font size and style + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param customText - pointer to a string text + * @param fontStyle - number to change font style (0-1; 0 - default; 1 - not implemented) + * @param fontSize - number to change font size (0-1; 0 - 8x8 pixels; 1 - 16x16 pixels) + * @param scrollEnable - number to enable scroll (0-1) + * @param positionX - number containing X cordinate to place the text + * @param positionY - number containing Y cordinate to place the text + * @return Operation status + */ + UFR_STATUS DL_API Display_PrintText(const char* customText, int fontStyle, int fontSize, int scrollEnable, int positionX, int positionY); + + /** + * @brief Function displays a chec or a cross bitmap and, if a speaker is connected to the display, it triggers a function that produces a beep sound + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param signal - number to display a check or a cross symbol on the display (1-2; 1-cross; 2-check) + * @return Operation status + */ + UFR_STATUS DL_API Display_UserInterfaceSignal(int signal); + + /** + * @brief Function writes the time on the display. If the display is not connected to the Reader, the time will be displayed and remain unchanged. However, if the display is connected to the Reader, the time will be shown only for a second because the Reader is sending the correct time to the display every second. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param hour - number that represetns the hour that will be drawn on the display + * @param minute - number that represetns the minute that will be drawn on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowTime(int hour, int minute); + + /** + * @brief Function clears a specified section of the display. If xPosEND or yPosEND are set to 0, the function will automatically assume that the end postion for erasing extends to the edge of the screen (i.e., xPosEND will default to the display's maximum width, and yPosEND will default to it's maximum height). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param xPos - number containing X coordinate to clear on the display, start position + * @param xPosEND - number containing X coordinate to clear on the display, end position + * @param yPos - number containing Y coordinate to clear on the display, start position + * @param yPosEND - number containing Y coordinate to clear on the display, end position + * @return Operation status + */ + UFR_STATUS DL_API Display_EraseSection(int xPos,int xPosEND,int yPos,int yPosEND); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceData(IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceData(OUT uint8_t *data); + + + + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + // XXX: Support for multiple readers with same DLL + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + + //-------------------------------------------------------------------------------------------------- + + ///--------------------------------------------------------------------- + /** + * @brief This is the first function in the order for execution for the multi-reader support. + * The function prepares the list of connected uF-readers to the system and returns the number of list items - number of connected uFR devices. + * ReaderList_UpdateAndGetCount() scans all communication ports for compatible devices, probes open readers if still connected, if not close and marks their handles for deletion. If some device is disconnected from the system this function should remove its handle. + * As of uFCoder version 5.0.73, this function probes both FTDI & COM devices and tries to open them. + * Each call to this method will close previously opened devices by this function, scan, and open everything found. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param NumberOfDevices how many compatible devices are connected to the system + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_UpdateAndGetCount(VAR int32_t *NumberOfDevices); + + /** + * @brief Used to retrieve information about a reader found & connected via ReaderList_UpdateAndGetCount(). + * This should be executed for each device based on number of devices found, providing valid index. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex index of the device in the readers list + * @param DeviceHandle assigned Handle + * @param DeviceSerialNumber device serial number + * @param DeviceType device type - device identification in AIS database + * @param DeviceFWver version of firmware + * @param DeviceCommID device identification number (master) + * @param DeviceCommSpeed communication speed + * @param DeviceCommFTDISerial FTDI COM port identification + * @param DeviceCommFTDIDescription FTDI COM port description + * @param DeviceIsOpened is Device opened + * @param DeviceStatus actual device status + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetInformation( // + uint32_t DeviceIndex, // index of the device to get information from + VAR UFR_HANDLE *DeviceHandle, //// assigned Handle + OUT c_string *DeviceSerialNumber, //// device serial number + VAR int *DeviceType, //// device type - device identification in AIS database + OUT c_string *DeviceFWver, //// version of firmware + VAR int *DeviceCommID, //// device identification number (master) + VAR int *DeviceCommSpeed, //// communication speed + OUT c_string *DeviceCommFTDISerial, //// FTDI COM port identification + OUT c_string *DeviceCommFTDIDescription, //// FTDI COM port description + VAR int *DeviceIsOpened, //// is Device opened + VAR int *DeviceStatus //// actual device status + ); + + /** + * @brief Force handle deletion when you identify that the reader is no longer connected, and want to release the handle immediately. If the handle exists in the list of opened devices, function would try to close communication port and destroy the handle. + * When uFR reader is disconnected, ReaderList_UpdateAndGetCount() will do that (destroy) automatically in next execution. + * + * @param DeviceHandle The handle that will be destroyed + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Destroy(UFR_HANDLE *DeviceHandle); + + /** + * @brief This method is used for manual addition of uFR devices to the list. Parameters used are the same as in ReaderOpenEx() method. Use this method if the device was not previously discovered by the ReaderList_UpdateAndGetCount() method. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceHandle the handle that will be assigned for interacting with the specified reader on success. + * @param reader_type Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_name Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_interface Refer to ReaderOpenEx() for detailed description of this parameter. arg Refer to ReaderOpenEx() for detailed description of this parameter. + * @param arg Refer to ReaderOpenEx() for detailed description of this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Add(UFR_HANDLE *DeviceHandle, uint32_t reader_type, + c_string port_name, uint32_t port_interface, void *arg); + + /** + * @brief Tries to re-open the device based on the serial number of the device. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param hndUFR handle of the uFR device + * @param Device_SN Serial number of the device contained as char array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenBySerial(VAR UFR_HANDLE *hndUFR, const char Device_SN[16]); + + // XXX: Obsolete functions - remain for backward compatibility + /** + * @brief + * Gets reader’s reader serial number as a pointer to 4 byte value, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulSerialNumber Contains reader serial number as a 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialByIndex(int32_t DeviceIndex, VAR uint32_t *lpulSerialNumber); + + /** + * @brief Gets reader’s descriptive name as a array of 8 chars, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param pSerialDescription Contains reader serial number as array of 8 chars + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialDescriptionByIndex(int32_t DeviceIndex, OUT uint8_t pSerialDescription[8]); + + /** + * @brief Gets devices reader type based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulReaderType Contains reader type as 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetTypeByIndex(int32_t DeviceIndex, VAR uint32_t *lpulReaderType); + + /** + * @brief Gets devices FTDI serial port number based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Serial Contains FTDI serial number as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDISerialByIndex(int32_t DeviceIndex, OUT char **Device_Serial); + + /** + * @brief Gets devices FTDI description based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Description FTDI description as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDIDescriptionByIndex(int32_t DeviceIndex, OUT char **Device_Description); + + /** + * @brief Tries to re-open the device based on the device index. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenByIndex(const int32_t DeviceIndex, VAR UFR_HANDLE *hndUFR); + + //-------------------------------------------------------------------------------------------------- + + // open first/next Reader and return handle - better to use ReaderList_OpenByIndex() + /** + * @brief Multi reader support. Open reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s, or if you have only one reader attached to another power supply (not your PC) it will open that reader based on it’s working mode (TCP or UDP). If you have more than one µFR Online device, ReaderOpen function will open the first one found, for opening another device, use ReaderOpenEx instead. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenM(VAR UFR_HANDLE *hndUFR); + +#ifdef ESP_PLATFORM + /** + * @brief @param hndUFR handle of the uFR device + * @param port_num + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderOpenM(VAR UFR_HANDLE *hndUFR, uint32_t port_num); +#endif + + /** + * @brief Multi reader support. Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderCloseM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTypeM(UFR_HANDLE hndUFR, OUT uint32_t *lpulReaderType); + + /** + * @brief Multi reader support. Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumberM(UFR_HANDLE hndUFR, OUT uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnectedM(UFR_HANDLE hndUFR, VAR uint32_t *connected); + + /** + * @brief Multi reader support. Store a new key or change existing key under provided index parameter.The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Multi reader support. Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. This function turns sound and light reader signals. Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignalM(UFR_HANDLE hndUFR, uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Multi reader support. From version 5.0.68. + * Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolumeM(UFR_HANDLE hndUFR, uint8_t sound_volume); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExtM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExtM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @param hndUFR handle of the uFR device + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * Multi reader support. From library version 5.0.36 and firmware version 5.0.37 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSakM(UFR_HANDLE hndUFR, uint16_t *atqa, uint8_t *sak); + + /** + * @brief Multi reader support. Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authenticationwith key A or key B:use KeyA - MIFARE_AUTHENT1A = 0x60or KeyB - MIFARE_AUTHENT1B = 0x61For NTAG 21x, Ultralight EV1 and other T2T tags supportingPWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead()or LinearRead_PK() functions. Value 0x60 with LinearRead() orLinearRead_PK() functions means “without PWD_AUTH“ and in thatcase you can send for ucReaderKeyIndex or aucProvidedKeyparameters anything you want without influence on the result. ForNTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTHyou can use _AKM1 or _AKM2 function variants only withoutPWD_AUTH in any case of the valid values (0x60 or 0x61) providedfor this parameter.For Mifare Plus tags (PK mode) defines whether to performauthentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCardM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKeyM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafeM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode)For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters + + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using absolute Block address. + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PKM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * Multi reader support. + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Multi reader support. Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + // New commands (for RTC & I2C EEPROM): + /** + * @brief Multi reader support. Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTimeM(UFR_HANDLE hndUFR, VAR uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into the device's RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password time + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTimeM(UFR_HANDLE hndUFR, IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Multi reader support. This function is used in Common, Advance and Access Control set of functions. + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPasswordM(UFR_HANDLE hndUFR, IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM. Maximal length of array is 128 bytes. Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWriteM(UFR_HANDLE hndUFR, IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescriptionM(UFR_HANDLE hndUFR, OUT uint8_t pSerialDescription[8]); + + // New since version 2.0: + /** + * @brief Multi reader support. Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumberM(UFR_HANDLE hndUFR, VAR uint8_t *build); + + /** + * @brief Multi reader support. This function returns UID of card actually present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief Multi reader support. This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi card mode: + //------------------------------------------------------------------------------ + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCardsM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + + /** + * @brief Multi reader support. Before calling this function you have to call EnumCards() first. + * For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCardsM(UFR_HANDLE hndUFR, OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + + /** + * @brief Multi reader support. Selects one of the cards which UID is on the actual UID list of the enumerated cards. If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCardM(UFR_HANDLE hndUFR, IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief Multi reader support. If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCardM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatusM(UFR_HANDLE hndUFR, VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns card type according to DlogicCardType enumeration. For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardTypeM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType); + + /** + * @brief Multi reader support. + * This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturerM(UFR_HANDLE hndUFR, OUT char* card_manufacturer_str); + + + /** + * @brief Multi reader support. This function returns 8 bytes of the T2T version. All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersionM(UFR_HANDLE hndUFR, OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Multi reader support. Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpulLinearSize pointer to variable which contain size of user data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSizeM(UFR_HANDLE hndUFR, VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * Multi reader support. From library version 5.0.59 and firmware version 5.0.60 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatusM(UFR_HANDLE hndUFR, OUT uint8_t *tt_message, VAR uint8_t *tt_status); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @param hndUFR handle of the uFR device + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @ingroup Card_Tag_M + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalDataM(UFR_HANDLE hndUFR, uint8_t data[32], uint32_t *len); + + /** + * @brief Multi reader support. Function returns reader’s serialized discovery loop structure i.e. C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetupM(UFR_HANDLE hndUFR, uint8_t *setupStruct, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoopM(UFR_HANDLE hndUFR, const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Multi reader support. Function returns the AID set in the reader to retrieve the mobile phone's unique ID. If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAidM(UFR_HANDLE hndUFR, uint8_t *aid, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAidM(UFR_HANDLE hndUFR, const uint8_t *aid, uint32_t len); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfigM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtpM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlotM(UFR_HANDLE hndUFR, uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKeyM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencryptedM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZoneM(UFR_HANDLE hndUFR, uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZoneM(UFR_HANDLE hndUFR, uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatusM(UFR_HANDLE hndUFR, VAR uint8_t *bool_config_zone_locked, + VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevisionM(UFR_HANDLE hndUFR, uint8_t revision[4]); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProModeM(UFR_HANDLE hndUFR, VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProModeM(UFR_HANDLE hndUFR, const uint32_t ReaderProMode); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_InitializeM(UFR_HANDLE hndUFR, IN const uint8_t *TBSerialString, uint16_t job_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCardM(UFR_HANDLE hndUFR, const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextM(UFR_HANDLE hndUFR, const uint32_t code_type, const uint32_t from_timestamp, + const uint32_t to_timestamp, const uint32_t additional_data_size, + IN const uint8_t additional_data[], VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSNM(UFR_HANDLE hndUFR, OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSNM(UFR_HANDLE hndUFR, VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSNM(UFR_HANDLE hndUFR, OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Multi reader support. Function returns TNF, type of record, ID and payload from the NDEF record. NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Multi reader support. Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, uint8_t *type_length, + IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, uint32_t *payload_length, + VAR uint8_t *card_formated); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroringM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_ttM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_countM(UFR_HANDLE hndUFR, VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, + OUT uint8_t *ndef_record_array, VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Multi reader support. Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_recordsM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initializationM(UFR_HANDLE hndUFR); + + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + + /** + * @brief Multi reader support. Function stores a message record for NTAG emulation mode into the reader. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefM(UFR_HANDLE hndUFR, uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, + uint8_t id_length, IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief Multi reader support. Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function returns current ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParamsM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. This command set ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParamsM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param is_field_present contains 0 if external field isn’t present or 1 if field is present. + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldStateM(UFR_HANDLE hndUFR, VAR uint8_t *is_field_present); + + /** + * @brief Multi reader support. Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. From library version 5.0.31, and firmware version 5.0.33 + * Function stores a message record for NTAG emulation mode into the reader in the RAM. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRamM(UFR_HANDLE hndUFR, uint8_t tnf, uint8_t *type_record, uint8_t type_length, + uint8_t *id, uint8_t id_length, uint8_t *payload, uint32_t payload_length); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking_M + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureM(UFR_HANDLE hndUFR, IN uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], + VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExtM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief Multi reader support. This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, uint32_t inc_value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successfulfunction execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterM(UFR_HANDLE hndUFR, VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RKM(UFR_HANDLE hndUFR, VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PKM(UFR_HANDLE hndUFR, VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Multi reader support. Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode sets idle mode value + * @param card_detection_mode sets card detection mode value + * @param idle_color sets idle color + * @param card_detection_color sets card detection color + * @param enabled value that enables it (1) or disables it (0) + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode returns idle mode value + * @param card_detection_mode returns card detection mode value + * @param idle_color returns idle color + * @param card_detection_color returns card detection color + * @param enabled returns 1 if enabled, 0 if disabled + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_numberM(UFR_HANDLE hndUFR, VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, VAR uint8_t *start_minute, + VAR uint8_t *end_hour, VAR uint8_t *end_minute, OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_recordM(UFR_HANDLE hndUFR, uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, + uint8_t begin_hour, uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, + uint8_t end_hour, uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_recordM(UFR_HANDLE hndUFR, VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, + VAR uint8_t *end_month, VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_typeM(UFR_HANDLE hndUFR, uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_typeM(UFR_HANDLE hndUFR, VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_durationM(UFR_HANDLE hndUFR, uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_durationM(UFR_HANDLE hndUFR, VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_durationM(UFR_HANDLE hndUFR, uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_durationM(UFR_HANDLE hndUFR, VAR uint32_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validityM(UFR_HANDLE hndUFR, VAR int32_t *credit, VAR uint32_t *begin_year, + VAR uint32_t *begin_month, VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, VAR uint32_t *end_year, VAR uint32_t *end_month, + VAR uint32_t *end_day, VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validityM(UFR_HANDLE hndUFR, int32_t credit, uint32_t begin_year, uint32_t begin_month, + uint32_t begin_day, uint32_t begin_hour, uint32_t begin_minute, uint32_t end_year, + uint32_t end_month, uint32_t end_day, uint32_t end_hour, uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint8_t *right_record_type, + OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counterM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, + uint16_t last_reader_nr, uint8_t start_hour, uint8_t start_minute, + uint8_t end_hour, uint8_t end_minute, IN uint8_t *days, + uint8_t max_daily_counter); + + //============================================================================= + + /** + * @brief Multi reader support. Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOnM(UFR_HANDLE hndUFR, uint16_t pulse_duration); + + /** + * @brief Multi reader support. Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayStateM(UFR_HANDLE hndUFR, uint8_t state); + + /** + * @brief Multi reader support. Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param intercom shows that there is voltage at the terminals for intercom connection, or not + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoStateM(UFR_HANDLE hndUFR, VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief + * Multi reader support. Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControlM(UFR_HANDLE hndUFR, uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Multi reader support. This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControlM(UFR_HANDLE hndUFR, uint8_t light_status); + + /** + * @brief Multi reader support. For classic uFR PLUS devices only. + * The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.55. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControlM(UFR_HANDLE hndUFR, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.64. + * The function sets color on the RGB diodes. This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleepM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.66. + * The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. Function also sets the number of omitted activity periods, when the RGB light is off. For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriodM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSetM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, uint8_t bad_select_nr_max); + + /** + * @brief Multi reader support. The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, VAR uint8_t *bad_select_nr_max); + + /** + * @brief Multi reader support. Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSetM(UFR_HANDLE hndUFR, uint8_t seconds_wait); + + /** + * @brief Multi reader support. Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGetM(UFR_HANDLE hndUFR, VAR uint8_t *seconds_wait); + + /** + * @brief Multi reader support. This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanentlyM(UFR_HANDLE hndUFR, unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Multi reader support. Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParametersM(UFR_HANDLE hndUFR, VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Multi reader support. Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayDataM(UFR_HANDLE hndUFR, IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Multi reader support. From version 5.0.55 + * Function has the same functionality as the function SetDisplayData. New feature is the RGB port selection. Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief Multi reader support. This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequencyM(UFR_HANDLE hndUFR, uint16_t frequency); + + /** + * @brief Multi reader support. SetRgbIntensity (alias from version 5.0.55) + * Function sets the intensity of light on the display. Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensityM(UFR_HANDLE hndUFR, uint8_t intensity); + + /** + * @brief Multi reader support. GetRgbIntensity (alias from version 5.0.55) + * Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensityM(UFR_HANDLE hndUFR, VAR uint8_t *intensity); + + // ############################################################################# + // ############################################################################# + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_ModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATSM(OUT UFR_HANDLE hndUFR, uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorageM(UFR_HANDLE hndUFR); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceiveM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint32_t *ufr_status); + /** + * @brief Multi reader support. + * Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_TransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, + uint8_t data_out_len, OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, + uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * Sends C–APDU in the c_string (zero terminated) format, containing pairs of the + hexadecimal digits. Pairs of the hexadecimal digits can be delimited by any of the punctuation + characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu C_APDU as string + * @param r_apdu R_APDU returned as string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceiveM(UFR_HANDLE hndUFR, IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief Multi reader support. + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are + sent and receive in the form of the byte arrays. There is obvious need for a c_apdu_len and + *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, + respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, + VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief Multi reader support. + * This is “exploded binary” alternative function intended for support APDU commands in ISO 14443- + 4A tags. APDUTransceive() receives separated parameters which are an integral part of the C– + APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls lcs + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, + uint32_t Nc, OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chainM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceiveM(UFR_HANDLE hndUFR, uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselectM(UFR_HANDLE hndUFR, uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceiveM(UFR_HANDLE hndUFR, uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, + uint8_t crypto1, uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Multi reader support. Function sets the parameters for transceive mode. If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_startM(UFR_HANDLE hndUFR, uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief Multi reader support. + * The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enableM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceiveM(UFR_HANDLE hndUFR, IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, + uint32_t bytes_to_receive, VAR uint32_t *rcv_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interfaceM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_GenericM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDUM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4M(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Using this function you can select the appropriate application on the card. For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAidM(UFR_HANDLE hndUFR, IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief Multi reader support. In JCApp cards you can put two types of asymmetric crypto keys. Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + const IN uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_type key_type + * @param key_index key_index + * @param key_designator key_designator + * @param key_bit_len key_bit_len + * @param params params + * @param params_size params_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPairM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, uint8_t key_designator, + uint16_t key_bit_len, IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBeginM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *chunk, uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdateM(UFR_HANDLE hndUFR, IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Multi reader support. Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEndM(UFR_HANDLE hndUFR, VAR uint16_t *sig_len); + + /** + * @brief Multi reader support. + * This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignatureM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *plain_data, uint16_t plain_data_len, VAR uint16_t *sig_len, + IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, + uint8_t id_size); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Multi reader support. + * Using this function you can delete certificate objects from a card. This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCertM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index); + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjIdM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + + /** + * @brief Multi reader support. + * This function is used to login to the JCApp with an appropriate PIN code. Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLoginM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief Multi reader support. This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemainingM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief Multi reader support. This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChangeM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief Multi reader support. + * This function is used to unblock PIN code which is specified by the SO parameter. + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblockM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, + OUT uint8_t *exponent, VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *keyW, VAR uint16_t *keyWSize, OUT uint8_t *field, + VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, + VAR uint16_t *g_size, OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, + VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); // when keyW == NULL, returns size + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBitsM(UFR_HANDLE hndUFR, uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list_size Pointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSizeM(UFR_HANDLE hndUFR, VAR uint32_t *list_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFilesM(UFR_HANDLE hndUFR, OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief Multi reader support. + * This function returns file size indexed by the parameter card_file_index, on successful execution. Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file which size we want to get + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSizeM(UFR_HANDLE hndUFR, uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated d Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief Multi reader support. + * This function reads a file from the DLStorage card directly to the new file on the host file-system. If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. Parameter data_size defines the amount of data to be written in the file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief Multi reader support. + * This function writes file content from the host file-system to the new file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * After successful call to this function, the file on the DLStorage card will be deleted. Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFileM(UFR_HANDLE hndUFR, uint8_t file_index); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBacM(UFR_HANDLE hndUFR, IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], + OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * Use this function to read files from the eMRTD NFC tag. You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param file_index file index + * @param output buffer that storese output + * @param output_length length of the returned output + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt send_sequence_cnt + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *file_index, VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * This function validates data groups read from the eMRTDocument. All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * ________________ + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidateM(UFR_HANDLE hndUFR, IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, + uint32_t verbose_level, OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + // ############################################################################# + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Start(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StartM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Stop(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StopM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Start(void); // Alias for uFR_DESFIRE_Start() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StartM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StartM() + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Stop(void); // Alias for uFR_DESFIRE_Stop() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StopM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StopM() + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUidM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3desM(UFR_HANDLE hndUFR, IN uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Provided Key mode (PK) + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function returns the available bytes on the card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param free_mem_byte pointer to free memory size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFreeMemM(UFR_HANDLE hndUFR, VAR uint32_t *free_mem_byte, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCardM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * Provided Key mode (PK) + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + /** + * @brief Multi reader support. Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Provided Key mode (PK) + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key provided key + * Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * No authentication + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + // 121212 + /** + * @brief Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. + * + * If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * Multi reader support + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationd2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfigurationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. Provided Key mode (PK) + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. No authentication + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Function allows to set card master key, and application master key configuration settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr ordinal number of AES key in the reader + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_2k3des_key_nr, uint8_t aid_key_no, uint8_t old_2k3des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_2k3des_key_nr, uint8_t aid_key_no, + uint8_t old_2k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key_nr ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_des3k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_3k3des_key_nr, uint8_t aid_key_no, + uint8_t old_3k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of the key stored in the reader + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. 128 bit AES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_des_key[8], uint8_t aid_key_no, IN uint8_t old_des_key[8], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_des_key[8], uint8_t aid_key_no, + IN uint8_t old_des_key[8], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key pointer to 32 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key 24 bytes array that represent 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key 24 bytes array that represent current 3K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des3k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_3k3des_key[24], uint8_t aid_key_no, + IN uint8_t old_3k3des_key[24], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key pointer to array contained new AES key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t auth_key_type, IN uint8_t *new_key, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr key index of AES key stored in the reader that will be new AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr key index of AES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeAesKey_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des3k_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_des3k_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange3k3desKey_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des3k_key_nr, uint8_t aid_key_no, uint8_t old_des3k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows you to change any AES key on the card. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. *only uFR CS with SAM support + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of a key stored in the reader that will be new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief + * Function writes AES key (16 bytes) into reader. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key in the reader (0 - 15) + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_no, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Function writes AES key (16 bytes) into reader. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param key_no ordinal number of key in the reader (0 - 15) + * @param key pointer to array containing the key + * @param key_type enumerated key type (0 - 3) + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteKeyM(UFR_HANDLE hndUFR, uint8_t key_no, IN uint8_t *key, uint8_t key_type); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIdsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_no_auth_M(UFR_HANDLE hndUFR, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t number_of_records, uint16_t record_size, uint8_t communication_settings, + uint8_t *data, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + uint8_t *data, + uint16_t *card_status, + uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuth_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileDesAuth_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile2k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. Provided Key mode (PK) + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multireader support. 128 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no ey for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsSdmAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows changing of file settings + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * *only uFR CS with SAM support + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetTransactionTimerAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). . + * + * Multi reader support. + * From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param card_uid 7 bytes length card UID + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireUidReadECCSignatureM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, OUT uint8_t *card_uid, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aesM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOnM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function prohibits the blinking of the green diode independently of the user's signaling command. LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOffM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOnM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOffM(UFR_HANDLE hndUFR); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t CWGsNOff, uint8_t ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API FastFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersM(UFR_HANDLE hndUFR, uint8_t *mui, uint8_t *serial_nr, uint8_t *hw_type, uint8_t *hw_ver, + uint8_t *device_type, uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrateM(UFR_HANDLE hndUFR, OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersPN7462_M(UFR_HANDLE hndUFR, uint8_t *die_id, uint8_t *serial_nr, + + uint8_t *hw_type, uint8_t *hw_ver, uint8_t *device_type, + uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + // SAM + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_rawM(UFR_HANDLE hndUFR, OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_versionM(UFR_HANDLE hndUFR, VAR SAM_HW_TYPE *sam_type, VAR uint8_t *sam_uid); + + /** + * @brief Multi reader support. Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_rawM(UFR_HANDLE hndUFR, uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_v ADD DESCRIPTION + * @param des_key ADD DESCRIPTION + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_desM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_keyM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param master_aes_key ADD DESCRIPTION + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_modeM(UFR_HANDLE hndUFR, IN uint8_t *master_aes_key, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plainM(UFR_HANDLE hndUFR, IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *keyA, + IN uint8_t *keyB, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_ULC_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_desfire_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, + uint8_t ver_a, IN uint8_t *aes_key_ver_b, uint8_t ver_b, + IN uint8_t *aes_key_ver_c, uint8_t ver_c, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, uint8_t sam_lock_unlock, + uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKeyM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * Multi reader support. + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeableM(UFR_HANDLE hndUFR); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * Multi reader support. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfResetM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOnM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch off RF field at the reader. + * + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOffM(UFR_HANDLE hndUFR); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderIdM(UFR_HANDLE hndUFR, uint8_t *reader_id); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePersoM(UFR_HANDLE hndUFR, uint16_t address, IN uint8_t *data); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPersoM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param card_master_key pointer to 16 byte array containing the card master key + * @param card_config_key pointer to 16 byte array containing the card configuration key + * @param level_2_switch_key pointer to 16 byte array containing the key for switch to security level 2 + * @param level_3_switch_key pointer to 16 byte array containing the key for switch to security level 3 + * @param level_1_auth_key pointer to 16 byte array containing the key for optional authentication at security level 1 + * @param select_vc_key pointer to 16 byte array containing the key for virtual card selection + * @param prox_chk_key pointer to 16 byte array containing the key for proximity check + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling + * @param vc_poll_mac_key pointer to 16 byte array containing the MAC key for virtual card polling + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimalM(UFR_HANDLE hndUFR, IN uint8_t *card_master_key, IN uint8_t *card_config_key, + IN uint8_t *level_2_switch_key, IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, + IN uint8_t *select_vc_key, IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, + IN uint8_t *vc_poll_mac_key); + + /** + * @brief Multi reader support. Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, + uint8_t prox_check_use); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ADordinary number of current sector key stored into reader that wile become new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKeyM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, + OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @param hndUFR handle of the uFR device + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PKM(UFR_HANDLE hndUFR, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief Multi reader support. Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PKM(UFR_HANDLE hndUFR, IN uint8_t *key); + + /** + * @brief Multi reader support. No authentication + * This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_authM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + // ESP32 + /** + * @brief Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. + * + * Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayData(IN uint8_t *display_data, IN uint8_t data_length, uint16_t duration); + + /** + * @brief Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderReset(void); + + /** + * @brief It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM of uFR Online. + * + * Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param time pointer to the array containing current date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTime(OUT uint8_t *time); + + /** + * @brief Function sets the date and time into uFR Online RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOState(uint8_t pin, uint8_t state); + + /** + * @brief Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOState(OUT uint8_t *state); + + /** + * @brief Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReader(uint8_t reader); + + /** + * @brief Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param SerialNumber pointer to SerialNumber variable. “SerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumber(VAR uint32_t *SerialNumber); + + /** + * @brief Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersion(OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOff(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifi(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableWifi(void); + + // NDEF MESSAGES + //---------------------------------------------------------- + + enum NDEF_STORAGE_MODE + { + STORE_INTO_READER = 0, + STORE_INTO_CARD + }; + + enum NDEF_SKYPE_ACTION + { + CALL = 0, + CHAT + }; + + // WiFi NDEF authentication type + enum WIFI_AUTH_TYPE + { + OPEN = 0, + WPA_PERSONAL, + WPA_ENTERPRISE, + WPA2_ENTERPRISE, + WPA2_PERSONAL + }; + + // WiFi NDEF encryption type + enum WIFI_ENC_TYPE + { + NONE = 0, + WEP, + TKIP, + AES, + AES_TKIP + }; + + /** + * @brief + * Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFi(uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, uint8_t encryption_type, + IN const char *password); + + /** + * @brief Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters)(e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BT(uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMS(uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Bitcoin(uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocation(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestination(uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Email(uint8_t ndef_storage, IN const char *email_address, IN const char *subject, IN const char *message); + + /** + * @brief Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Address(uint8_t ndef_storage, IN const char *address); + + /** + * @brief Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidApp(uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Store text as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Text(uint8_t ndef_storage, IN const char *text); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetView(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Skype(uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Whatsapp(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Viber(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Contact(uint8_t ndef_storage, IN const char *name, IN const char *company, IN const char *address, + IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Phone(uint8_t ndef_storage, IN const char *phone_number); + + /** + * @brief Multi reader support. Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFiM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, + uint8_t encryption_type, IN const char *password); + + /** + * @brief Multi reader support. Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters) (e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BTM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Multi reader support. Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMSM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Multi reader support. Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BitcoinM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Multi reader support. Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_EmailM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *email_address, IN const char *subject, + IN const char *message); + + /** + * @brief Multi reader support. Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AddressM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *address); + + /** + * @brief Multi reader support. Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Multi reader support. Store text as NDEF message into reader or into card. + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_TextM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *text); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetViewM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SkypeM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Multi reader support. Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WhatsappM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ViberM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ContactM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *name, IN const char *company, + IN const char *address, IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Multi reader support. Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_PhoneM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number); + //--------------------------------------------------------------------------------------------- + /** + * @brief Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF + * + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFi(OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, OUT char *password); + + /** + * @brief Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Bitcoin(OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocation(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF + * + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestination(OUT char *destination); + + /** + * @brief Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Email(OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF + * + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Address(OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF + * + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidApp(OUT char *package_name); + + /** + * @brief Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF + * + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Text(OUT char *text); + + /** + * @brief Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetView(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF + * + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Skype(OUT char *user_name, OUT char *action); + + /** + * @brief Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Whatsapp(OUT char *message); + + /** + * @brief Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Viber(OUT char *message); + + /** + * @brief Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF + * + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Contact(OUT char *vCard); + + /** + * @brief Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Phone(OUT char *phone_number); + + /** + * @brief Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMS(OUT char *phone_number, OUT char *message); + + /** + * @brief Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BT(OUT char *bt_mac_address); + + /** + * @brief Multi reader support. Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFiM(UFR_HANDLE hndUFR, OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, + OUT char *password); + + /** + * @brief Multi reader support. Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BitcoinM(UFR_HANDLE hndUFR, OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, OUT char *destination); + + /** + * @brief Multi reader support. Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_EmailM(UFR_HANDLE hndUFR, OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AddressM(UFR_HANDLE hndUFR, OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, OUT char *package_name); + + /** + * @brief Multi reader support. Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_TextM(UFR_HANDLE hndUFR, OUT char *text); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetViewM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SkypeM(UFR_HANDLE hndUFR, OUT char *user_name, OUT char *action); + + /** + * @brief Multi reader support. Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WhatsappM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ViberM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ContactM(UFR_HANDLE hndUFR, OUT char *vCard); + + /** + * @brief Multi reader support. Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_PhoneM(UFR_HANDLE hndUFR, OUT char *phone_number); + + /** + * @brief Multi reader support. Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMSM(UFR_HANDLE hndUFR, OUT char *phone_number, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BTM(UFR_HANDLE hndUFR, OUT char *bt_mac_address); + + /** + * @brief Used to parse NDEF record into separate parameters + * + * @ingroup Card_Tag_NDEF + * + * @param type_record pointer to the array containing record type + * @param type_len length of the record type + * @param payload pointer to the array containing record payload + * @param payload_len length of the record payload + * + * @return Operation status + */ + c_string DL_API ParseNdefMessage(IN uint8_t *type_record, uint8_t type_len, IN uint8_t *payload, uint32_t payload_len); + + // NT4H + + /** + * @brief Multi reader support. Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parametersM(UFR_HANDLE hndUFR, uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function returns file settings. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext); + + /** + * @brief Multi reader support. Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_ridM(UFR_HANDLE hndUFR, uint8_t aes_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uidM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_keyM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctrM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. No authentication + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_authM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signatureM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_statusM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_authM(UFR_HANDLE hndUFR, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_ttM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_fileM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief Multi reader support. Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint16_t duration); + + /** + * @brief Multi reader support. Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPasswordM(UFR_HANDLE hndUFR, uint8_t *old_password, uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM of uFR Online. Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWriteM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size, uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromReadM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into uFR Online RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *password, uint8_t *time); + + /** + * @brief Multi reader support. Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOStateM(UFR_HANDLE hndUFR, uint8_t pin, uint8_t state); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOStateM(UFR_HANDLE hndUFR, uint8_t *state); + + /** + * @brief Multi reader support. Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReaderM(UFR_HANDLE hndUFR, uint8_t reader); + + /** + * @brief Multi reader support. Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumberM(UFR_HANDLE hndUFR, uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersionM(UFR_HANDLE hndUFR, OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Multi reader support. Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOffM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableOnWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceDataM(UFR_HANDLE hndUFR, IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceDataM(UFR_HANDLE hndUFR, OUT uint8_t *data); + + + /** + * @brief Multi reader support. As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + + UFR_STATUS DL_API COMTransceiveM(UFR_HANDLE hndUFR, IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General + * + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + UFR_STATUS DL_API COMTransceive(IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + // DLL version ---------------------------------------------------------------- + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + uint32_t DL_API GetDllVersion(void); + + /* + * Get "exploded" dll version example: + * + * #include + * #include + * + * void main(int argc, char *argv[]) + * { + * uint32_t dwDllVersion = 0; + * uint32_t dwDllMajorVersion = 0; + * uint32_t dwDllMinorVersion = 0; + * uint32_t dwDllBuild = 0; + * + * dwDllVersion = GetDllVersion(); + * + * // "explode" the dll version: + * dwDllMajorVersion = (DWORD)(LOBYTE(LOWORD(dwDllVersion))); + * dwDllMinorVersion = (DWORD)(HIBYTE(LOWORD(dwDllVersion))); + * + * // Get the dll build number. + * dwDllBuild = (DWORD)(HIWORD(dwDllVersion)); + * + * printf("Dll version is %ld.%ld (%ld)\n", dwDllMajorVersion, + * dwDllMinorVersion, + * dwDllBuild); + * } + * + */ + // Originality Check (performs the check is the chip on the card/tag NXP genuine): + /** + * @brief This function depends on OpenSSL crypto library. Since OpenSSL crypto library is dynamically linked during execution, the only prerequisite for a successful call to this function is that the libeay32.dll is in the current folder (valid for Windows) and / or libcrypto.so is in the environment path (e.g. LD_LIBRARY_PATH on Linux / macOS). OriginalityCheck() performs the check if the chip on the card / tag is NXP genuine. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param signature ECCSignature acquired by call to the ReadECCSignature() function. + * @param uid Card UID. Best if the card UID is acquired by previous call to the ReadECCSignature() function. + * @param uid_len Card UID length. Best if the card UID length is acquired by previous call to the ReadECCSignature() function. + * @param DlogicCardType Card type. Best if the DlogicCardType is acquired by previous call to the ReadECCSignature() function. + * + * @return Operation status + */ + UFR_STATUS DL_API OriginalityCheck(IN const uint8_t *signature, IN const uint8_t *uid, uint8_t uid_len, uint8_t DlogicCardType); + // Returns: + // UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND in case there is no OpenSSL library (libeay32.dll) in current folder or path + // UFR_OPEN_SSL_DYNAMIC_LIB_FAILED in case of OpenSSL library error (e.g. wrong OpenSSL version) + // UFR_NOT_NXP_GENUINE if chip on the card/tag is NOT NXP genuine + // UFR_OK is chip on the card/tag is NXP GENUINE + + //// debug functions: + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + c_string DL_API GetDllVersionStr(void); + + /** + * @brief Returns UFR_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param status UFR_STATUS status variable + * + * @return Operation status + */ + c_string DL_API UFR_Status2String(const UFR_STATUS status); + + /** + * @brief Returns UFR_SESSION_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param session_status UFR_SESSION_STATUS status variable + * + * @return c_string value of the status code + */ + c_string DL_API UFR_SessionStatus2String(const UFR_SESSION_STATUS session_status); + + /** + * @brief Returns card type as a c_string instead of byte value + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param dl_type_code card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + c_string DL_API UFR_DLCardType2String(uint8_t dl_type_code); + +//// Helper functions: +#ifndef _WIN32 + + unsigned long GetTickCount(void); + +#endif // #ifndef _WIN32 + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information + * + * @return The reader's descriptive name + */ + c_string DL_API GetReaderDescription(void); + + /** + * @brief Multi reader support. This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * + * @return Returns the reader's descriptive name. + */ + c_string DL_API GetReaderDescriptionM(UFR_HANDLE hndUFR); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +//#ifdef _WIN32 || __linux__ + +//#else +//#endif // _WIN32 + + + +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +#ifdef __ANDROID__ +#include + + extern JNIEnv *global_env; + extern jclass global_class; + extern jclass usb_global_class; + + /** + + * + * @param env + * @param class1 + * + * @return Operation status + */ + void DL_API initVM(JNIEnv *env, jclass class1); +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __APPLE__ +#include + #if TARGET_OS_IPHONE + typedef void (*CardDetectedCallback)(void* _Nonnull context,const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(void* _Nonnull context); + typedef void (*SessionErrorCallback)(void* _Nonnull context, UFR_SESSION_STATUS error_code, const char* error_description); + /** + * @brief For iOS only: This function is used to set message displayed when the NFC Session window is started
+ * E.g 'Read the tag with the phone' + * NFC Session can be started via ReaderOpenEx() and appropriate parameters, or openNFCSession() + * @since uFCoder library version 6.0.0 + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + void setNFCMessage(const char *message); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * @param context pointer to UIView that bridges Swift with native code. e.g `let ble_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(void* _Nonnull context, const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + void DL_API closeBLESession(void); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param context pointer to UIView that bridges Swift with native code. e.g `let nfc_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(void* _Nonnull context, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + #else + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); + + #endif // TARGET_OS_IPHONE +#endif // __APPLE__ + +#ifdef __ANDROID__ + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param reader_sn uFR Online reader serial number (e.g ONXXXXXX) + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param session_error_callback TEST + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openBLESession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeBLESession(void); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); +#endif // __ANDROID__ + +#if defined(_WIN32) || defined(__linux__) + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief This function is used to enable asynchronous event-driven API callbacks.
+ * Prerequisites: ReaderOpen() or ReaderOpenEx() must be called first and must return `UFR_OK` status to open connection with the reader
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by StartAsyncSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + UFR_STATUS DL_API StopAsyncSession(); + +#endif // _WIN32 || __linux__ + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardDetectedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardDetectedCallback(CardDetectedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardRemovedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardRemovedCallback(CardRemovedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'SessionErrorCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setSessionErrorCallback(SessionErrorCallback callback); + + + +#endif /* uFCoder_H_ */ diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64/libuFCoder-ios-static.a b/lib/ios_framework/uFCoder.xcframework/ios-arm64/libuFCoder-ios-static.a new file mode 100644 index 0000000000000000000000000000000000000000..a5a1141c2f7dc2a9e84157d443194a109c91079a Binary files /dev/null and b/lib/ios_framework/uFCoder.xcframework/ios-arm64/libuFCoder-ios-static.a differ diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap new file mode 100644 index 0000000000000000000000000000000000000000..ff3803f4dc348fcaa9330a568f7cf7a94a1c6333 --- /dev/null +++ b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap @@ -0,0 +1,5 @@ +module uFCoder { + header "uFCoder.h" + + export * +} diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/uFCoder.h b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/uFCoder.h new file mode 100644 index 0000000000000000000000000000000000000000..2dd864183dbc98fe670f68c7c8b1cec9cfd01197 --- /dev/null +++ b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/Headers/uFCoder.h @@ -0,0 +1,49439 @@ +/* + * uFCoder.h + * + * library version: 6.0.9 + * + * Created on: 2009-01-14 + * Last edited: 2025-03-05 + * + * Author: D-Logic + */ +#ifndef uFCoder_H_ +#define uFCoder_H_ + +#include +#include +#include + +#define IN // array that you pass to function +#define OUT // array that you receive from function +#define VAR // first element of array that you receive from function (single variable) + +//////////////////////////////////////////////////////////////////// +/** + * Type for representing null terminated char array ( aka C-String ) + * Array is always one byte longer ( for null character ) then string + * Memory space for array must be allocated before use. + */ +typedef const char *c_string; +//////////////////////////////////////////////////////////////////// + +#ifdef _WIN32 +// WINDOWS +#if defined(DL_CREATE_STATIC_LIB) || defined(DL_USE_STATIC_LIB) +#define DL_API +#else +#ifndef DL_uFC_EXPORTS +#ifdef _WIN_IOT +#define DL_API __declspec(dllimport) // Win IoT +#else +#define DL_API /*__declspec(dllimport) */ __stdcall // STDCALL - GCC - .NET +#endif // _WIN_IOT +#else +#define DL_API __declspec(dllexport) __stdcall +#endif // DL_uFC_EXPORTS +#endif // DL_CREATE_STATIC_LIB +#else +// Linux & MAC OS +#define DL_API +#endif // _WIN32 + +#if defined(DL_uFC_EXPORTS) || defined(DL_CREATE_STATIC_LIB) || defined(__ANDROID__) || defined(ESP_PLATFORM) || defined(IOS_PLATFORM) +typedef struct S_UFR_HANDLE *UFR_HANDLE; +#else +typedef void *UFR_HANDLE; +#endif + +// MIFARE CLASSIC type id's: +#define MIFARE_CLASSIC_1k 0x08 +#define MF1ICS50 0x08 +#define SLE66R35 0x88 // Infineon = Mifare Classic 1k +#define MIFARE_CLASSIC_4k 0x18 +#define MF1ICS70 0x18 +#define MIFARE_CLASSIC_MINI 0x09 +#define MF1ICS20 0x09 + +// DLOGIC CARD TYPE +#define TAG_UNKNOWN 0 +#define DL_MIFARE_ULTRALIGHT 0x01 +#define DL_MIFARE_ULTRALIGHT_EV1_11 0x02 +#define DL_MIFARE_ULTRALIGHT_EV1_21 0x03 +#define DL_MIFARE_ULTRALIGHT_C 0x04 +#define DL_NTAG_203 0x05 +#define DL_NTAG_210 0x06 +#define DL_NTAG_212 0x07 +#define DL_NTAG_213 0x08 +#define DL_NTAG_215 0x09 +#define DL_NTAG_216 0x0A +#define DL_MIKRON_MIK640D 0x0B +#define NFC_T2T_GENERIC 0x0C +#define DL_NT3H_1101 0x0D +#define DL_NT3H_1201 0x0E +#define DL_NT3H_2111 0x0F +#define DL_NT3H_2211 0x10 +#define DL_NTAG_413_DNA 0x11 +#define DL_NTAG_424_DNA 0x12 +#define DL_NTAG_424_DNA_TT 0x13 +#define DL_NTAG_210U 0x14 +#define DL_NTAG_213_TT 0x15 + +#define DL_MIFARE_CLASSIC_2K 0x19 +#define DL_MIFARE_MINI 0x20 +#define DL_MIFARE_CLASSIC_1K 0x21 +#define DL_MIFARE_CLASSIC_4K 0x22 +#define DL_MIFARE_PLUS_S_2K_SL0 0x23 +#define DL_MIFARE_PLUS_S_4K_SL0 0x24 +#define DL_MIFARE_PLUS_X_2K_SL0 0x25 +#define DL_MIFARE_PLUS_X_4K_SL0 0x26 +#define DL_MIFARE_DESFIRE 0x27 +#define DL_MIFARE_DESFIRE_EV1_2K 0x28 +#define DL_MIFARE_DESFIRE_EV1_4K 0x29 +#define DL_MIFARE_DESFIRE_EV1_8K 0x2A +#define DL_MIFARE_DESFIRE_EV2_2K 0x2B +#define DL_MIFARE_DESFIRE_EV2_4K 0x2C +#define DL_MIFARE_DESFIRE_EV2_8K 0x2D +#define DL_MIFARE_PLUS_S_2K_SL1 0x2E +#define DL_MIFARE_PLUS_X_2K_SL1 0x2F +#define DL_MIFARE_PLUS_EV1_2K_SL1 0x30 +#define DL_MIFARE_PLUS_X_2K_SL2 0x31 +#define DL_MIFARE_PLUS_S_2K_SL3 0x32 +#define DL_MIFARE_PLUS_X_2K_SL3 0x33 +#define DL_MIFARE_PLUS_EV1_2K_SL3 0x34 +#define DL_MIFARE_PLUS_S_4K_SL1 0x35 +#define DL_MIFARE_PLUS_X_4K_SL1 0x36 +#define DL_MIFARE_PLUS_EV1_4K_SL1 0x37 +#define DL_MIFARE_PLUS_X_4K_SL2 0x38 +#define DL_MIFARE_PLUS_S_4K_SL3 0x39 +#define DL_MIFARE_PLUS_X_4K_SL3 0x3A +#define DL_MIFARE_PLUS_EV1_4K_SL3 0x3B +#define DL_MIFARE_PLUS_SE_SL0 0x3C +#define DL_MIFARE_PLUS_SE_SL1 0x3D +#define DL_MIFARE_PLUS_SE_SL3 0x3E +#define DL_MIFARE_DESFIRE_LIGHT 0x3F + +#define DL_UNKNOWN_ISO_14443_4 0x40 +#define DL_GENERIC_ISO14443_4 0x40 +#define DL_GENERIC_ISO14443_4_TYPE_B 0x41 +#define DL_GENERIC_ISO14443_3_TYPE_B 0x42 +#define DL_MIFARE_PLUS_EV1_2K_SL0 0x43 +#define DL_MIFARE_PLUS_EV1_4K_SL0 0x44 +#define DL_MIFARE_DESFIRE_EV3_2K 0x45 +#define DL_MIFARE_DESFIRE_EV3_4K 0x46 +#define DL_MIFARE_DESFIRE_EV3_8K 0x47 + +#define DL_MOBILE_AID 0x60 +#define DL_APPLE_VAS_V1 0x6A +#define DL_APPLE_VAS_V2 0x6B +#define DL_IMEI_UID 0x80 + +// ST Product ID-s: +#define M24SR02 0x82 +#define M24SR02_AUTOMOTIVE 0x8A +#define M24SR04 0x86 +#define M24SR04_AUTOMOTIVE 0x8E +#define M24SR16 0x85 +#define M24SR16_AUTOMOTIVE 0x8D +#define M24SR64 0x84 +#define M24SR64_AUTOMOTIVE 0x8C + +// DLJavaCardTypes: +#define DLSigner81 0xA0 +#define DLSigner22 0xA1 +#define DLSigner30 0xA2 +#define DLSigner10 0xA3 +#define DLSigner145 0xAA + +enum E_CARD_IN_SAM_SLOT +{ + SAM_SLOT_MIFARE_SAM_AV2 = 1, + SAM_SLOT_GENERIC = 4 +}; + +// DLJavaCardSignerAlgorithmTypes: +enum E_SIGNER_CIPHERS +{ + SIG_CIPHER_RSA = 0, + SIG_CIPHER_ECDSA, + + SIG_CIPHER_MAX_SUPPORTED +}; + +enum E_SIGNER_RSA_PADDINGS +{ + PAD_NULL = 0, + PAD_PKCS1_V1_5, + PAD_PKCS1_PSS, + + SIG_PAD_MAX_SUPPORTED +}; +#define PAD_PKCS1 PAD_PKCS1_V1_5 + +enum E_SIGNER_DIGESTS +{ + ALG_NULL = 0, + ALG_SHA, + ALG_SHA_256, + ALG_SHA_384, + ALG_SHA_512, + ALG_SHA_224, + ALG_SHA_512_224, + ALG_SHA_512_256, + + SIG_DIGEST_MAX_SUPPORTED +}; + +enum E_KEY_TYPES +{ + TYPE_RSA_PRIVATE = 0, + TYPE_RSA_CRT_PRIVATE, + TYPE_EC_F2M_PRIVATE, + TYPE_EC_FP_PRIVATE +}; + +enum E_OBJ_TYPES +{ + OBJ_TYPE_RSA_CERT = 0, + OBJ_TYPE_EC_CERT, + OBJ_TYPE_CA_CERT, + + OBJ_TYPES_COUNT +}; + +// JCDL_AIDs +#define DL_RAW_SIZEOF_SZ(x) (sizeof(x) - 1) +#define DL_AID_RID_PLUS "\xF0" "DLogic" +#define DL_SIGNER_PIX "\x00\x01" +#define DL_STORAGE_PIX "\x01\x01" +#define DL_SIGNER_AID DL_AID_RID_PLUS DL_SIGNER_PIX +#define DL_SIGNER_AID_SIZE 9 +#define DL_STORAGE_AID DL_AID_RID_PLUS DL_STORAGE_PIX +#define DL_STORAGE_AID_SIZE 9 + +// Universal JCDL instructions: +#define INS_LOGIN 0x20 +#define INS_GET_PIN_TRIES_REMAINING 0x21 +#define INS_PIN_CHANGE 0x22 +#define INS_PIN_UNBLOCK 0x23 + +// JCDLStorage instructions: +#define INS_PIN_ENABLE 0x24 +#define INS_PIN_DISABLE 0x25 +#define INS_LIST_FILES 0x31 +#define INS_GET_FILE_SIZE 0x32 +#define INS_READ_FILE 0x33 +#define INS_WRITE_FILE 0x34 +#define INS_DELETE_FILE 0x3F + +// JCDLSigner instructions: +#define INS_SET_RSA_PRIKEY 0x51 +#define INS_GEN_RSA_KEY_PAIR 0x52 +#define INS_GET_RSA_PUBKEY_MODULUS 0x53 +#define INS_GET_RSA_PUBKEY_EXPONENT 0x54 +#define INS_DEL_RSA_KEY_PAIR 0x5F +#define INS_SET_EC_PRIKEY 0x61 +#define INS_GEN_EC_KEY_PAIR 0x62 +#define INS_GET_EC_PUBKEY 0x63 +#define INS_GET_EC_FIELD 0x64 +#define INS_GET_EC_AB 0x65 +#define INS_GET_EC_G 0x66 +#define INS_GET_EC_RK_SIZE 0x67 +#define INS_DEL_EC_KEY_PAIR 0x6F +#define INS_GET_SIGNATURE 0x71 +#define INS_PUT_OBJ 0x31 +#define INS_PUT_OBJ_SUBJECT 0x32 +#define INS_INVALIDATE_CERT 0x33 +#define INS_GET_OBJ 0x41 +#define INS_GET_OBJ_ID 0x42 +#define INS_GET_OBJ_SUBJECT 0x43 + +// Universal JCDL constants: +#define PIN_MAX_TRIES 5 +#define PIN_MIN_LENGTH 4 +#define PIN_MAX_LENGTH 8 +#define PUK_MAX_TRIES 10 +#define PUK_LENGTH 8 + +// JCDLSigner constants: +#define JC_APP_MAX_KEY_INDEX ((3) - 1) +#define JC_APP_MAX_CA_CERT_INDEX ((12) - 1) +#define JC_APP_MAX_ID_SIZE 253 +#define JC_APP_MAX_SUBJECT_SIZE 255 +#define JC_APP_MAX_SIGNATURE_LEN 256 +#define JC_APP_MAX_PIN_LENGTH 8 + +// JCDLStorage constants: +#define JC_DL_STORAGE_MAX_FILES 16 +#define JC_DL_STORAGE_MAX_FILE_SIZE (32 * 1024 - 2) // 32KB - 2 byte system reserved + +// MIFARE CLASSIC Authentication Modes: +enum MIFARE_AUTHENTICATION +{ + MIFARE_AUTHENT1A = 0x60, + MIFARE_AUTHENT1B = 0x61, +}; + +// MIFARE PLUS AES Authentication Modes: +enum MIFARE_PLUS_AES_AUTHENTICATION +{ + MIFARE_PLUS_AES_AUTHENT1A = 0x80, + MIFARE_PLUS_AES_AUTHENT1B = 0x81, +}; + +enum MIFARE_PLUS_AES_KEY_TYPE +{ + MIFARE_PLUS_AES_KEY_A = 1, + MIFARE_PLUS_AES_KEY_B = 2, +}; + +// T2T authentication constants: +enum T2T_AUTHENTICATION +{ + T2T_NO_PWD_AUTH = 0, + T2T_RKA_PWD_AUTH = 1, + T2T_PK_PWD_AUTH = 3, + T2T_WITHOUT_PWD_AUTH = 0x60, + T2T_WITH_PWD_AUTH = 0x61, +}; + +// T4T authentication constants +enum T4T_AUTHENTICATION +{ + T4T_WITHOUT_PWD_AUTH = 0x60, + T4T_PK_PWD_AUTH = 0x80, + T4T_RKA_PWD_AUTH = 0x02, +}; + +enum ADDRESS_MODE +{ + ADDRESS_MODE_BLOCK = 0, + ADDRESS_MODE_SECTOR, +}; + +#define MAX_UID_LEN 10 +#define MAX_ATS_LEN 25 +#define ECC_SIG_LEN 32 + +// API Status Codes Type: +typedef enum UFCODER_ERROR_CODES +{ + UFR_OK = 0x00, + UFR_COMMUNICATION_ERROR = 0x01, + UFR_CHKSUM_ERROR = 0x02, + UFR_READING_ERROR = 0x03, + UFR_WRITING_ERROR = 0x04, + UFR_BUFFER_OVERFLOW = 0x05, + UFR_MAX_ADDRESS_EXCEEDED = 0x06, + UFR_MAX_KEY_INDEX_EXCEEDED = 0x07, + UFR_NO_CARD = 0x08, + UFR_COMMAND_NOT_SUPPORTED = 0x09, + UFR_FORBIDEN_DIRECT_WRITE_IN_SECTOR_TRAILER = 0x0A, + UFR_ADDRESSED_BLOCK_IS_NOT_SECTOR_TRAILER = 0x0B, + UFR_WRONG_ADDRESS_MODE = 0x0C, + UFR_WRONG_ACCESS_BITS_VALUES = 0x0D, + UFR_AUTH_ERROR = 0x0E, + UFR_PARAMETERS_ERROR = 0x0F, + UFR_MAX_SIZE_EXCEEDED = 0x10, + UFR_UNSUPPORTED_CARD_TYPE = 0x11, + + UFR_COMMUNICATION_BREAK = 0x50, + UFR_NO_MEMORY_ERROR = 0x51, + UFR_CAN_NOT_OPEN_READER = 0x52, + UFR_READER_NOT_SUPPORTED = 0x53, + UFR_READER_OPENING_ERROR = 0x54, + UFR_READER_PORT_NOT_OPENED = 0x55, + UFR_CANT_CLOSE_READER_PORT = 0x56, + UFR_BLE_INVALID_PAIRING = 0x57, + + UFR_I2C_BUS_ERROR = 0x6A, + UFR_ECC_STORAGE_ERROR = 0x6B, + + UFR_WRITE_VERIFICATION_ERROR = 0x70, + UFR_BUFFER_SIZE_EXCEEDED = 0x71, + UFR_VALUE_BLOCK_INVALID = 0x72, + UFR_VALUE_BLOCK_ADDR_INVALID = 0x73, + UFR_VALUE_BLOCK_MANIPULATION_ERROR = 0x74, + UFR_WRONG_UI_MODE = 0x75, + UFR_KEYS_LOCKED = 0x76, + UFR_KEYS_UNLOCKED = 0x77, + UFR_WRONG_PASSWORD = 0x78, + UFR_CAN_NOT_LOCK_DEVICE = 0x79, + UFR_CAN_NOT_UNLOCK_DEVICE = 0x7A, + UFR_DEVICE_EEPROM_BUSY = 0x7B, + UFR_RTC_SET_ERROR = 0x7C, + + ANTI_COLLISION_DISABLED = 0x7D, + NO_TAGS_ENUMERRATED = 0x7E, + CARD_ALREADY_SELECTED = 0x7F, + + // NDEF error codes + UFR_WRONG_NDEF_CARD_FORMAT = 0x80, + UFR_NDEF_MESSAGE_NOT_FOUND = 0x81, + UFR_NDEF_UNSUPPORTED_CARD_TYPE = 0x82, + UFR_NDEF_CARD_FORMAT_ERROR = 0x83, + UFR_MAD_NOT_ENABLED = 0x84, + UFR_MAD_VERSION_NOT_SUPPORTED = 0x85, + UFR_NDEF_MESSAGE_NOT_COMPATIBLE = 0x86, + + // Tag emulation mode errors: + FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90, + + // FTDI errors: + UFR_FT_STATUS_ERROR_1 = 0xA0, + UFR_FT_STATUS_ERROR_2 = 0xA1, + UFR_FT_STATUS_ERROR_3 = 0xA2, + UFR_FT_STATUS_ERROR_4 = 0xA3, + UFR_FT_STATUS_ERROR_5 = 0xA4, + UFR_FT_STATUS_ERROR_6 = 0xA5, + UFR_FT_STATUS_ERROR_7 = 0xA6, + UFR_FT_STATUS_ERROR_8 = 0xA7, + UFR_FT_STATUS_ERROR_9 = 0xA8, + + // MIFARE PLUS error codes + UFR_MFP_COMMAND_OVERFLOW = 0xB0, + UFR_MFP_INVALID_MAC = 0xB1, + UFR_MFP_INVALID_BLOCK_NR = 0xB2, + UFR_MFP_NOT_EXIST_BLOCK_NR = 0xB3, + UFR_MFP_COND_OF_USE_ERROR = 0xB4, + UFR_MFP_LENGTH_ERROR = 0xB5, + UFR_MFP_GENERAL_MANIP_ERROR = 0xB6, + UFR_MFP_SWITCH_TO_ISO14443_4_ERROR = 0xB7, + UFR_MFP_ILLEGAL_STATUS_CODE = 0xB8, + UFR_MFP_MULTI_BLOCKS_READ = 0xB9, + + // NT4H error codes + NT4H_COMMAND_ABORTED = 0xC0, + NT4H_LENGTH_ERROR = 0xC1, + NT4H_PARAMETER_ERROR = 0xC2, + NT4H_NO_SUCH_KEY = 0xC3, + NT4H_PERMISSION_DENIED = 0xC4, + NT4H_AUTHENTICATION_DELAY = 0xC5, + NT4H_MEMORY_ERROR = 0xC6, + NT4H_INTEGRITY_ERROR = 0xC7, + NT4H_FILE_NOT_FOUND = 0xC8, + NT4H_BOUNDARY_ERROR = 0xC9, + NT4H_INVALID_MAC = 0xCA, + NT4H_NO_CHANGES = 0xCB, + + // multiple units - return from the functions with ReaderList_ prefix in name + UFR_DEVICE_WRONG_HANDLE = 0x100, + UFR_DEVICE_INDEX_OUT_OF_BOUND, + UFR_DEVICE_ALREADY_OPENED, + UFR_DEVICE_ALREADY_CLOSED, + UFR_DEVICE_IS_NOT_CONNECTED, + + // Originality Check Error Codes: + UFR_NOT_NXP_GENUINE = 0x200, + UFR_OPEN_SSL_DYNAMIC_LIB_FAILED, + UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND, + + // DESFIRE Card Status Error Codes: + READER_ERROR = 0xBB7, // 2999 [dec] + NO_CARD_DETECTED = 0xBB8, // 3000 [dec] + CARD_OPERATION_OK = 0xBB9, // 3001 [dec] + WRONG_KEY_TYPE = 0xBBA, // 3002 [dec] + KEY_AUTH_ERROR = 0xBBB, // 3003 [dec] + CARD_CRYPTO_ERROR = 0xBBC, // 3004 [dec] + READER_CARD_COMM_ERROR = 0xBBD, // 3005 [dec] + PC_READER_COMM_ERROR = 0xBBE, // 3006 [dec] + COMMIT_TRANSACTION_NO_REPLY = 0xBBF, // 3007 [dec] + COMMIT_TRANSACTION_ERROR = 0xBC0, // 3008 [dec] + NOT_SUPPORTED_KEY_TYPE = 0xBC2, // 3010 [dec] + WRONG_FILE_TYPE = 0xBC3, // 3011 [dec] + + DESFIRE_CARD_NO_CHANGES = 0x0C0C, + DESFIRE_CARD_OUT_OF_EEPROM_ERROR = 0x0C0E, + DESFIRE_CARD_ILLEGAL_COMMAND_CODE = 0x0C1C, + DESFIRE_CARD_INTEGRITY_ERROR = 0x0C1E, + DESFIRE_CARD_NO_SUCH_KEY = 0x0C40, + DESFIRE_CARD_LENGTH_ERROR = 0x0C7E, + DESFIRE_CARD_PERMISSION_DENIED = 0x0C9D, + DESFIRE_CARD_PARAMETER_ERROR = 0x0C9E, + DESFIRE_CARD_APPLICATION_NOT_FOUND = 0x0CA0, + DESFIRE_CARD_APPL_INTEGRITY_ERROR = 0x0CA1, + DESFIRE_CARD_AUTHENTICATION_ERROR = 0x0CAE, + DESFIRE_CARD_ADDITIONAL_FRAME = 0x0CAF, + DESFIRE_CARD_BOUNDARY_ERROR = 0x0CBE, + DESFIRE_CARD_PICC_INTEGRITY_ERROR = 0x0CC1, + DESFIRE_CARD_COMMAND_ABORTED = 0x0CCA, + DESFIRE_CARD_PICC_DISABLED_ERROR = 0x0CCD, + DESFIRE_CARD_COUNT_ERROR = 0x0CCE, + DESFIRE_CARD_DUPLICATE_ERROR = 0x0CDE, + DESFIRE_CARD_EEPROM_ERROR_DES = 0x0CEE, + DESFIRE_CARD_FILE_NOT_FOUND = 0x0CF0, + DESFIRE_CARD_FILE_INTEGRITY_ERROR = 0x0CF1, + DESFIRE_CATD_AUTHENTICATION_DELAY = 0X0CAD, + + // uFCoder library errors: + UFR_NOT_IMPLEMENTED = 0x1000, + UFR_COMMAND_FAILED = 0x1001, + UFR_TIMEOUT_ERR = 0x1002, + UFR_FILE_SYSTEM_ERROR = 0x1003, + UFR_FILE_SYSTEM_PATH_NOT_EXISTS = 0x1004, + UFR_FILE_NOT_EXISTS = 0x1005, + UFR_FTD2XX_DLL_NOT_FOUND = 0x1006, + + // uFCoder library/licensing specific + UFR_JSON_INVALID = 0x1012, + UFR_LICENSE_INVALID = 0x1013, + UFR_LICENSE_SAVE_FAILED = 0x1014, + UFR_LICENSE_NOT_FOUND = 0x1015, + UFR_LICENSE_HAS_EXPIRED = 0x1016, + + // SAM module error codes: + UFR_SAM_APDU_ERROR = 0x2000, + UFR_SAM_AUTH_ERROR, + UFR_SAM_CRYPTO_ERROR, + + // TLS, HTTPS Error Codes: + TLS_ERR_OPENING_SOCKET = 0x5000, + TLS_ERR_NO_SUCH_HOST = 0x5001, + TLS_CONNECTING_ERROR = 0x5002, + TLS_ERR_SERVER_UNEXPECTEDLY_CLOSED_CONNECTION = 0x5003, + TLS_ERR_UNKNOWN_GIDS_CERTIFICATE_FORMAT = 0x5004, + TLS_ERR_SET_PIN_FOR_GIDS_CERT_ONLY = 0x5005, + TLS_ERR_GIDS_PIN_CODE_WRONG = 0x5006, + TLS_ERR_UNSUPPORTED_CERTIFICATE_TYPE = 0x5007, + TLS_ERR_PRIVATE_KEY_CONTEXT_WRONG = 0x5008, + + // JC cards APDU Error Codes: + UFR_APDU_TRANSCEIVE_ERROR = 0xAE, + UFR_APDU_JC_APP_NOT_SELECTED = 0x6000, + UFR_APDU_JC_APP_BUFF_EMPTY = 0x6001, + UFR_APDU_WRONG_SELECT_RESPONSE = 0x6002, + UFR_APDU_WRONG_KEY_TYPE = 0x6003, + UFR_APDU_WRONG_KEY_SIZE = 0x6004, + UFR_APDU_WRONG_KEY_PARAMS = 0x6005, + UFR_APDU_WRONG_SIGNING_ALGORITHM = 0x6006, + UFR_APDU_PLAIN_TEXT_MAX_SIZE_EXCEEDED = 0x6007, + UFR_APDU_UNSUPPORTED_KEY_SIZE = 0x6008, + UFR_APDU_UNSUPPORTED_ALGORITHMS = 0x6009, + UFR_APDU_PKI_OBJECT_NOT_FOUND = 0x600A, + UFR_APDU_MAX_PIN_LENGTH_EXCEEDED = 0x600B, + UFR_DIGEST_LENGTH_DOES_NOT_MATCH = 0x600C, + + // reserved: 0x6100, + CRYPTO_SUBSYS_NOT_INITIALIZED = 0x6101, + CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR = 0x6102, + CRYPTO_SUBSYS_MAX_HASH_INPUT_EXCEEDED = 0x6103, + CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM = 0x6104, + CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM = 0x6105, + CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM = 0x6106, + CRYPTO_SUBSYS_WRONG_SIGNATURE = 0x6107, + CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH = 0x6108, + CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE = 0x6109, + CRYPTO_SUBSYS_HASHING_ERROR = 0x610A, + CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS = 0x610B, + CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY = 0x610C, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS = 0x610D, + CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY = 0x610E, + + UFR_WRONG_PEM_CERT_FORMAT = 0x61C0, + + // X.509 specific statuses: + X509_CAN_NOT_OPEN_FILE = 0x6200, + X509_WRONG_DATA = 0x6201, + X509_WRONG_LENGTH = 0x6202, + X509_UNSUPPORTED_PUBLIC_KEY_TYPE = 0x6203, + X509_UNSUPPORTED_PUBLIC_KEY_SIZE = 0x6204, + X509_UNSUPPORTED_PUBLIC_KEY_EXPONENT = 0x6205, + X509_EXTENSION_NOT_FOUND = 0x6206, + X509_WRONG_SIGNATURE = 0x6207, + X509_UNKNOWN_PUBLIC_KEY_TYPE = 0x6208, + X509_WRONG_RSA_PUBLIC_KEY_FORMAT = 0x6209, + X509_WRONG_ECC_PUBLIC_KEY_FORMAT = 0x620A, + X509_SIGNATURE_NOT_MATCH_CA_PUBLIC_KEY = 0x620B, + X509_UNSUPPORTED_SIGNATURE_SCH = 0x620C, + X509_UNSUPPORTED_ECC_CURVE = 0x620D, + + // PKCS#7 specific statuses: + PKCS7_WRONG_DATA = 0x6241, + PKCS7_UNSUPPORTED_SIGNATURE_SCHEME = 0x6242, + PKCS7_SIG_SCH_NOT_MATCH_CERT_KEY_TYPE = 0x6243, + + PKCS7_WRONG_SIGNATURE = 0x6247, + + // MRTD specific statuses: + MRTD_SECURE_CHANNEL_SESSION_FAILED = 0x6280, + MRTD_WRONG_SOD_DATA = 0x6281, + MRTD_WRONG_SOD_LENGTH = 0x6282, + MRTD_UNKNOWN_DIGEST_ALGORITHM = 0x6283, + MRTD_WARNING_DOES_NOT_CONTAINS_DS_CERT = 0x6284, + MRTD_DATA_GROUOP_INDEX_NOT_EXIST = 0x6285, + MRTD_EF_COM_WRONG_DATA = 0x6286, + MRTD_EF_DG_WRONG_DATA = 0x6287, + MRTD_EF_DG1_WRONG_LDS_VERSION_LENGTH = 0x6288, + MRTD_VERIFY_CSCA_NOT_EXIST = 0x6289, + MRTD_VERIFY_WRONG_DS_SIGNATURE = 0x628A, + MRTD_VERIFY_WRONG_CSCA_SIGNATURE = 0x628B, + MRTD_MRZ_CHECK_ERROR = 0x628C, + + // ICAO Master List specific statuses: + ICAO_ML_WRONG_FORMAT = 0x6300, + ICAO_ML_CAN_NOT_OPEN_FILE = 0x6301, + ICAO_ML_CAN_NOT_READ_FILE = 0x6302, + ICAO_ML_CERTIFICATE_NOT_FOUND = 0x6303, + ICAO_ML_WRONG_SIGNATURE = 0x6307, + + // EMV specific statuses + SYS_ERR_OUT_OF_MEMORY = 0x7001, + EMV_ERR_WRONG_INPUT_DATA = 0x7002, + EMV_ERR_MAX_TAG_LEN_BYTES_EXCEEDED = 0x7004, + EMV_ERR_TAG_NOT_FOUND = 0x7005, + EMV_ERR_TAG_WRONG_SIZE = 0x7006, + EMV_ERR_TAG_WRONG_TYPE = 0x7007, + EMV_ERR_IN_CARD_READER = 0x7008, + EMV_ERR_READING_RECORD = 0x7009, + EMV_ERR_PDOL_IS_EMPTY = 0x7010, + EMV_ERR_LIST_FORMAT_NOT_FOUND = 0x7011, + EMV_ERR_AFL_NOT_FOUND = 0x7012, + EMV_ERR_AID_NOT_FOUND = 0x7013, + + // ISO7816-4 Errors (R-APDU) - 2 SW bytes returned by the card, prefixed with 0x000A: + UFR_APDU_SW_TAG = 0x000A0000, + UFR_APDU_SW_OPERATION_IS_FAILED = 0x000A6300, + UFR_APDU_SW_WRONG_PIN_4_TRIES_REMAINING = 0x000A63C4, + UFR_APDU_SW_WRONG_PIN_3_TRIES_REMAINING = 0x000A63C3, + UFR_APDU_SW_WRONG_PIN_2_TRIES_REMAINING = 0x000A63C2, + UFR_APDU_SW_WRONG_PIN_1_TRIES_REMAINING = 0x000A63C1, + UFR_APDU_SW_WRONG_PIN_0_TRIES_REMAINING = 0x000A63C0, + UFR_APDU_SW_WRONG_LENGTH = 0x000A6700, + UFR_APDU_SW_SECURITY_STATUS_NOT_SATISFIED = 0x000A6982, + UFR_APDU_SW_AUTHENTICATION_METHOD_BLOCKED = 0x000A6983, + UFR_APDU_SW_DATA_INVALID = 0x000A6984, + UFR_APDU_SW_CONDITIONS_NOT_SATISFIED = 0x000A6985, + UFR_APDU_SW_WRONG_DATA = 0x000A6A80, + UFR_APDU_SW_FILE_NOT_FOUND = 0x000A6A82, + UFR_APDU_SW_RECORD_NOT_FOUND = 0x000A6A83, + UFR_APDU_SW_DATA_NOT_FOUND = 0x000A6A88, + UFR_APDU_SW_ENTITY_ALREADY_EXISTS = 0x000A6A89, + UFR_APDU_SW_INS_NOT_SUPPORTED = 0x000A6D00, + UFR_APDU_SW_NO_PRECISE_DIAGNOSTIC = 0x000A6F00, + + MAX_UFR_STATUS = 0x7FFFFFFF, + + UFR_DISPLAY_IMAGE_LOAD_ERROR = 0x8001, + UFR_DISPLAY_IMAGE_DIMENSION_ERROR = 0x8002, + UFR_DISPLAY_IMAGE_UNSUPPORTED_CHANNELS = 0x8003, + UFR_DISPLAY_WRITE_CMD_ERROR = 0x8004, + UFR_DISPLAY_READ_ACK_ERROR = 0x8005, + UFR_DISPLAY_WRITE_CMDEXT_ERROR = 0x8006, + UFR_DISPLAY_READ_RESPONSE_ERROR = 0x8007, + UFR_DISPLAY_TEXT_COUNT_OVERFLOW = 0x8008, + UFR_DISPLAY_INDEX_OVERFLOW = 0x8009, + UFR_DISPLAY_WRONG_SIMBOL_NUMB = 0x8010, + UFR_DISPLAY_COMMAND_FAILED = 0x8011 + +} UFR_STATUS; + +typedef enum UFCODER_SESSION_CODES +{ + UFR_SESSION_UNKNOWN_ERROR = 0x00, + UFR_SESSION_CLOSED = 0x01, + UFR_SESSION_EXPIRED = 0x02, + UFR_SESSION_DEVICE_DISCONNECTED = 0x03, + UFR_SESSION_DEVICE_FAILED_TO_CONNECT = 0x04, + + // BLE specific error codes + UFR_BLE_SESSION_ERROR_INVALID_PARAMETERS = 0x11, + UFR_BLE_SESSION_ERROR_INVALID_HANDLE = 0x12, + UFR_BLE_SESSION_ERROR_NOT_CONNECTED = 0x13, + UFR_BLE_SESSION_ERROR_OUT_OF_SPACE = 0x14, + UFR_BLE_SESSION_ERROR_OPERATION_CANCELLED = 0x15, + UFR_BLE_SESSION_ERROR_CONNECTION_TIMEOUT = 0x16, + UFR_BLE_SESSION_ERROR_UUID_NOT_ALLOWED = 0x17, + UFR_BLE_SESSION_ERROR_ALREADY_ADVERTISING = 0x18, + UFR_BLE_SESSION_ERROR_CONNECTION_LIMIT_REACHED = 0x19, + UFR_BLE_SESSION_ERROR_UNKNOWN_DEVICE = 0x20, + UFR_BLE_SESSION_ERROR_OPERATION_NOT_SUPPORTED = 0x21, + UFR_BLE_SESSION_ERROR_PEER_REMOVED_PAIRING_INFORMATION = 0x22, + UFR_BLE_SESSION_ERROR_ENCRYPTION_TIMED_OUT = 0x23, + UFR_BLE_SESSION_ERROR_TOO_MANY_LE_PAIRED_DEVICES = 0x24, + + // NFC specific error codes + + // Sesssion errors + UFR_NFC_SESSION_ERROR_FIRST_NDEF_TAG_READ = 0x30, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TERMINATED_UNEXPECTEDLY = 0x31, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_TIMEOUT = 0x32, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_SYSTEM_IS_BUSY = 0x33, + UFR_NFC_SESSION_ERROR_SESSION_INVALIDATION_USER_CANCELED = 0x34, + + // NDEF errors + UFR_NFC_SESSION_ERROR_TAG_NOT_WRITABLE = 0x40, + UFR_NFC_SESSION_ERROR_TAG_SIZE_TOO_SMALL = 0x41, + UFR_NFC_SESSION_ERROR_TAG_UPDATE_FAILURE = 0x42, + UFR_NFC_SESSION_ERROR_ZERO_LENGTH_MESSAGE = 0x43, + + // Transceive errors + UFR_NFC_SESSION_ERROR_RETRY_EXCEEDED = 0x50, + UFR_NFC_SESSION_ERROR_TAG_CONNECTION_LOST = 0x51, + UFR_NFC_SESSION_ERROR_TAG_NOT_CONNECTED = 0x52, + UFR_NFC_SESSION_ERROR_TAG_RESPONSE_ERROR = 0x53, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_SESSION_INVALIDATED = 0x54, + UFR_NFC_SESSION_ERROR_TAG_TRANSCEIVE_PACKET_TOO_LONG = 0x55, + + UFR_NFC_SESSION_ERROR_TAG_COMMAND_CONFIGURATION_INVALID_PARAMETERS = 0x56, + + // Other + UFR_NFC_SESSION_ERROR_UNSUPPORTED_FEATURE = 0x61, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER = 0x62, + UFR_NFC_SESSION_ERROR_INVALID_PARAMETER_LENGTH = 0x63, + UFR_NFC_SESSION_ERROR_PARAMETER_OUT_OF_BOUNDS = 0x64, + UFR_NFC_SESSION_ERROR_RADIO_DISABLED = 0x65, + UFR_NFC_SESSION_ERROR_SECURITY_VIOLATION = 0x66, + +} UFR_SESSION_STATUS; + +// DESFIRE key settings values +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE 0x09 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE 0x0F +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x01 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x08 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE 0x0E +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x00 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE 0x06 + +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x00 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x01 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x02 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x03 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x04 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x05 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x06 +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_NOT_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x07 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WITH_AUTH 0x08 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WITH_AUTH 0x09 +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0A +#define DESFIRE_KEY_SET_CREATE_WITH_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0B +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTH_AUTH 0x0C +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTH_AUTH 0x0D +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_NOT_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0E +#define DESFIRE_KEY_SET_CREATE_WITHOUT_AUTH_SET_CHANGE_KEY_CHANGE_APP_IDS_WIDTHOUT_AUTH 0x0F + +enum E_ASYMMETRIC_KEY_TYPES +{ + RSA_PRIVATE_KEY = 0, + ECDSA_PRIVATE_KEY, + + ASYMMETRIC_KEY_TYPES_NUM +}; + +#define MAX_ECC_CURVE_NAME_LEN 30 + +enum E_ECC_CURVE_DEFINITION_TYPES +{ + ECC_CURVE_INDEX, + ECC_CURVE_NAME, + ECC_CURVE_DOMAIN_PARAMETERS, + + ECC_CURVE_DEFINITION_TYPES_NUM +}; + +enum E_SIGNATURE_SCHEMES +{ + SHA1_WITH_RSA, + SHA256_WITH_RSA, + SHA384_WITH_RSA, + SHA512_WITH_RSA, + SHA224_WITH_RSA, + SHA512_224_WITH_RSA, + SHA512_256_WITH_RSA, + + RSA_PSS, + + ECDSA_WITH_SHA1, + ECDSA_WITH_SHA256, + ECDSA_WITH_SHA384, + ECDSA_WITH_SHA512, + ECDSA_WITH_SHA224, + + SIGNATURE_SCHEMES_NUM // Don't change the order. NEVER! +}; +enum E_SIGNATURE_SCH_TYPES +{ + RSA_PKCS1, + RSA_PKCS1_PSS, + ECDSA, + + SIGNATURE_SCH_TYPES_NUM +}; +enum E_PUB_KEY_TYPES +{ + PUB_KEY_TYPE_RSA, + PUB_KEY_TYPE_ECDSA_NAMED_CURVE, + PUB_KEY_TYPE_ECDSA_DOMAIN_PARAMS, + + PUB_KEY_TYPES_NUM +}; + +enum E_BIT_ENCODINGS +{ + ENCODING_BIN, + ENCODING_HEX +}; + +enum E_CERTIFICATE_TYPES +{ + X509_PEM, + X509_DER, + X509_GIDS_NFC, + + E_CERTIFICATE_TYPES_NUM +}; + +enum E_ECC_CURVES +{ + secp112r1, + secp112r2, + secp128r1, + secp128r2, + secp160r1, + secp160r2, + secp160k1, + secp192r1, + prime192v2, + prime192v3, + secp192k1, + secp224r1, + secp224k1, + secp256r1, + secp256k1, + secp384r1, + secp521r1, + prime239v1, + prime239v2, + prime239v3, + brainpoolP160r1, + brainpoolP192r1, + brainpoolP224r1, + brainpoolP256r1, + brainpoolP320r1, + brainpoolP384r1, + brainpoolP512r1, + brainpoolP160t1, + brainpoolP192t1, + brainpoolP224t1, + brainpoolP256t1, + brainpoolP320t1, + brainpoolP384t1, + brainpoolP512t1, + + ECC_CURVES_NUM + + /* Not supported in uFCoder library yet: + sect113r1, + sect113r2, + sect131r1, + sect131r2, + sect163k1, + sect163r1, + sect163r2, + sect193r1, + sect193r2, + sect233k1, + sect233r1, + sect239k1, + sect283k1, + sect283r1, + sect409k1, + sect409r1, + sect571k1, + sect571r1 + */ +}; +// #define F2M_CURVES sect113r1 + +typedef struct +{ + uint8_t *serial; + uint8_t *subject; + uint8_t *issuer; + uint8_t *SKI; + uint8_t *AKI; + uint32_t serial_len; + uint32_t subject_len; + uint32_t issuer_len; + uint32_t SKI_len; + uint32_t AKI_len; +} icaoMlSearchCriteria_t; + +typedef struct +{ + uint32_t ecc_curve_field_type; + void *field_domain_params; // To be defined. For now only a named primary field curves are supported. +} ecc_curve_domain_params_t; + +typedef struct +{ + uint32_t ecc_curve_definition_type; // one of the E_ECC_CURVE_DEFINITION_TYPES + uint32_t ecc_curve_index; + char *ecc_curve_name; + ecc_curve_domain_params_t *ecc_curve_domain_params; +} ecc_key_param_t; + +enum E_MRTD_IMG_TYPE +{ + MRTD_IMG_JPEG = 0, + MRTD_IMG_JP2 = 1, + MRTD_IMG_JPEG2000 = 1, // Alias for the MRTD_IMG_JP2 + + MRTD_IMG_TYPE_UNKNOWN = 0xFFFFFFFF +}; + +typedef enum +{ + USER_PIN = 0, + SO_PIN, + USER_PUK, + SO_PUK +} dl_sec_code_t; + +enum E_PRINT_VERBOSE_LEVELS +{ + PRINT_NONE, + PRINT_ESSENTIALS, + PRINT_DETAILS, + PRINT_ALL_PLUS_STATUSES, +}; + +// SAM definition +typedef enum E_SAM_HW_VER +{ + SAM_UNKNOWN_TYPE, + SAM_T1AD2060_AV1_MODE, + SAM_T1AD2060_AV2_MODE, + SAM_T1AR1070_AV1_MODE, + SAM_T1AR1070_AV2_MODE +} SAM_HW_TYPE; + +// Reader status +typedef enum E_EMULATION_MODES +{ + TAG_EMU_DISABLED, + TAG_EMU_DEDICATED, + TAG_EMU_COMBINED, + TAG_EMU_AUTO_AD_HOC +} emul_modes_t; + +typedef enum E_EMULATION_STATES +{ + EMULATION_NONE, + EMULATION_IDLE, + EMULATION_AUTO_COLL, + EMULATION_ACTIVE, + EMULATION_HALT, + EMULATION_POWER_OFF +} emul_states_t; + +typedef enum E_PCD_MGR_STATES +{ + PCD_MGR_NO_RF_GENERATED, + PCD_MGR_14443A_POLLING, + PCD_MGR_14443A_SELECTED, + PCD_MGR_CE_DEDICATED, + PCD_MGR_CE_COMBO_START, + PCD_MGR_CE_COMBO, + PCD_MGR_CE_COMBO_IN_FIELD +} pcd_states_t; + +enum E_RGB_PORT_NAMES +{ + EXTERNAL_RGB_PORT, + INTERNAL_RGB_PORT +}; + +enum E_CUSTOM_UI_IDLE_MODES +{ + CUSTOM_UI_IDLE_MODE_NONE = 0, + CUSTOM_UI_IDLE_MODE_STATIC_LED, + CUSTOM_UI_IDLE_MODE_BLINKING_LED, + CUSTOM_UI_IDLE_MODES_NUMBER_INDICATOR +}; + +enum E_CUSTOM_UI_DETECTED_MODES +{ + CUSTOM_UI_DETECTED_MODE_NONE = 0, + CUSTOM_UI_DETECTED_MODE_STATIC_LED, + CUSTOM_UI_DETECTED_MODE_STATIC_LED_BEEP, + CUSTOM_UI_DETECTED_MODE_BEEP, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED, + CUSTOM_UI_DETECTED_MODE_BLINKING_LED_BEEP, + CUSTOM_UI_DETECTED_MODES_NUMBER_INDICATOR +}; + +#ifdef __cplusplus +extern "C" +{ +#endif + + /** + * @defgroup INTERNAL !!!INTERNAL!!! uFR API calls (Not for public SDK use) (remove from final revision) + * @{ + */ + /** @} */ // end of defgroup INTERNAL + + /** + * @defgroup UNDOCUMENTED UNDOCUMENTED uFR API calls (remove from final revision) + * @brief Excluded from docs due to the nature of their usage + * @{ + */ + /**@}*/ // end of defgroup INTERNAL + + /** @defgroup LibLic Library licensing + * @brief Prerequisite API calls for facilitating use of uFR MDK (Mobile Development Kit) with Android/iOS devices (usage of mobile device internal NFC antenna) + * @{ + */ + /** @} */ // end of LibLic + + /** @defgroup SingleReader Single Reader + * @{ + */ + /** @defgroup ReaderAndLibrary Reader and library + ** @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication + + /** @defgroup ReaderAndLibrary_Information Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information + + /** @defgroup ReaderAndLibrary_EEPROM EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM + + /** @defgroup ReaderAndLibrary_Signalization Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization + + /** @defgroup ReaderAndLibrary_RGBSignalization RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL. + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl Display Control + * @since uFCoder library version 6.0.5 + * + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures + + /** @defgroup ReaderAndLibrary_uFROnlineCommands uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands + + /** @defgroup ReaderAndLibrary_BaseHDUFR uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR + + /** @defgroup ReaderAndLibrary_NXPSAM Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM + + /** @defgroup ReaderAndLibrary_HelperFunc Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc + + /**@}*/ // end of defgroup ReaderAndLibrary + + /** @defgroup Card_Tag Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockRead(), BlockWrite(), LinearRead(), LinearWrite() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF + + /** @defgroup Card_Tag_NTAG_2XX NTAG2XX (Type 2) specific commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG + + /** @defgroup Card_Tag_NT4H NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H + + /** @defgroup Card_Tag_Mifare_Desfire Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire + + /** @defgroup Card_Tag_Mifare_Desfire_Light Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Desfire_Light + + /** @defgroup Card_Tag_Mifare_Plus Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Plus + + /** @defgroup Card_Tag_Ultralight_C Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Ultralight_C + + /** @defgroup Card_Tag_JavaCardApplication Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication + + /** @defgroup Card_Tag_CardFeatures Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4 ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4 + + /** @defgroup Card_Tag_CardFeatures_ISO7816 ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816 + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification + + /** @defgroup Card_Tag_CardFeatures_MRTD Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD + + /** @defgroup Card_Tag_CardFeatures_TLS TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS + + /** @defgroup Card_Tag_CardFeatures_EMV Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV + + /** @defgroup Card_Tag_CardFeatures_AntiCollision Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode + + /**@}*/ // end of defgroup Card_Tag_CardFeatures + + /**@}*/ // end of defgroup Card_Tag + + /** @defgroup Miscellaneous Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous + + /**@}*/ // end of defgroup SingleReader + + /** @defgroup MultiReader MultiReader + * @{ + ** @defgroup ReaderAndLibrary_ReaderList Handling multiple readers + * @brief If you want to communicate and use multiple readers from an application, you have to follow the + * initial procedure for enumerating uFR compatible devices and getting their handles + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_ReaderList + + /** @defgroup ReaderAndLibrary_M Reader and library + * @brief Functions related to reader itself, to obtain some info or set certain device parameters. + * @{ + */ + /** @defgroup ReaderAndLibrary_Communication_M Communication with the reader + * @brief Functions related to establishing, closing and changing speed of communication with the reader and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Communication_M + + /** @defgroup ReaderAndLibrary_Information_M Information about the reader + * @brief Functions related to getting information about the reader, e.g serial number, hardware/fimware version, reader type and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Information_M + + /** @defgroup ReaderAndLibrary_EEPROM_M EEPROM manipulation + * @brief Functions related to reading/writing data in the reader EEPROM, e.g user data, keys and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_EEPROM_M + + /** @defgroup ReaderAndLibrary_Signalization_M Signalization (default) + * @brief Functions related to interacting with the basic reader signalization + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_Signalization_M + + /** @defgroup ReaderAndLibrary_RGBSignalization_M RGB Signalization + * @brief Functions related to RGB signalization on supported reader types. E.g uFR Zero series, uFR Classic CS, uFR Advance, uFR XL + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_RGBSignalization_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_M Specific firmware features for uFR Series NFC readers + * @brief uFR Series readers specific firmware features, advanced set of different functions such as RTC, Display control, Tag emulation (dedicated/combined/ad-hoc) and more + * @{ + */ + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M Real Time Clock (RTC) + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M Display Control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M Tag emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M Combined emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M Ad-Hoc emulation mode + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M Shared RAM + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M Asynchronous UID Sending + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M Sleep and Auto Sleep + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + + /** @defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M RF Analog register settings + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + + /**@}*/ // end of defgroup ReaderAndLibrary_uFRSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M Specific firmware features for uFR Zero Series NFC readers + * @brief uFR Zero Series readers specific firmware features + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + + /** @defgroup ReaderAndLibrary_uFROnlineCommands_M uFR Online Reader specific commands + * @brief Functions related to uFR Online series readers only, specifically targetting the embedded ESP32 MCU + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_uFROnlineCommands_M + + /** @defgroup ReaderAndLibrary_BaseHDUFR_M uFR library support for Base HD NFC readers + * @brief Functions related to toggling BaseHD reader relay and access control + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_BaseHDUFR_M + + /** @defgroup ReaderAndLibrary_NXPSAM_M Support for NXP SAM (Secure Application Module) + * @brief Functions related to interacting with the SAM (Secure Application Module), such as authentication, key entry and more + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_NXPSAM_M + + /** @defgroup ReaderAndLibrary_HelperFunc_M Helper library functions + * @{ + */ + /**@}*/ // end of defgroup ReaderAndLibrary_HelperFunc_M + + /**@}*/ // end of defgroup ReaderAndLibrary_M + + /** @defgroup Card_Tag_M Card/tag commands + ** @brief Functions used for card (or tag) data manipulation, such as obtaining some info, reading or writing data into card + * @{ + */ + /** @defgroup Card_Tag_General_M General purpose card related commands + ** @brief Functions for getting common card data, not specific to card type. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_General + + /** @defgroup Card_Tag_Mifare_M Mifare Classic specific commands + ** @brief Functions specific to Mifare Classic® family of cards (Classic 1K and 4K). All functions + * are dedicated for use with Mifare Classic® cards. However, some functions can be used + * with other card types, mostly in cases of direct addressing scheme. E.g BlockReadM(), BlockWriteM(), LinearReadM(), LinearWriteM() can be used also with the NTAG2XX tags. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare + + /** @defgroup Card_Tag_NDEF_M NDEF related commands + ** @brief Functions for reading and writing common NDEF messages and records into various NFC tags. + * Currently, only NFC Type 2 Tags are supported, while support for other NFC Tag types will be added in future upgrades. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NDEF_M + + /** @defgroup Card_Tag_NTAG_2XX_M NTAG2XX (Type 2) related commands + ** @brief Functions specific to NTAG® family chips such as NTAG 203, 210, 212, 213, 215, 216. Due to the different memory sizes of various NTAG chips, we implemented functions for handling NTAG chips as generic NFC Type 2 Tag. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NTAG_2XX_M + + /** @defgroup Card_Tag_NT4H_M NT4H (Type 4) specific commands + ** @brief Functions specific to NT4H (Type 4) chips (e.g NTAG424DNA, with TagTamper support) + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_NT4H_M + + /** @defgroup Card_Tag_Mifare_Desfire_M Mifare DESFire specific commands + ** @brief Functions specific to Mifare DESFire® cards. All uFR Series readers support DESfire set of commands in AES encryption mode according to manufacturer's recommendations. In addition to AES, support for DES/2K3DES/3K3DES included. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_M + + /** @defgroup Card_Tag_Mifare_Desfire_Light_M Mifare DESFire Light specific commands + ** @brief Functions specific to Mifare DESFire® Light cards. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_Mifare_Desfire_Light_M + + /** @defgroup Card_Tag_Mifare_Plus_M Mifare Plus specific commands + ** @brief Functions specific to Mifare Plus cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Mifare_Plus_M + + /** @defgroup Card_Tag_Ultralight_C_M Ultralight C specific commands + ** @brief Functions specific to Ultralight C cards. + * @{ + */ + /**@}*/ + // end of defgroup Card_Tag_Ultralight_C_M + + /** @defgroup Card_Tag_JavaCardApplication_M Java Card Application (JCApp) specific commands + ** @brief "Java Card" refers to a contactless or dual interface Java Cards. For now, we have supported two JCApps in our uFR Series NFC API. Those JCApps are DLSigner and DLStorage. + * @{ + */ + /** @defgroup Card_Tag_JavaCardApplication_Common_M Common JCApp PIN functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_Common_M + + /** @defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M PKI infrastructure and digital signature support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + + /** @defgroup Card_Tag_JavaCardApplication_DLStorage_M DLStorage JCApp support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_DLStorage_M + + /**@}*/ // end of defgroup Card_Tag_JavaCardApplication_M + + /** @defgroup Card_Tag_CardFeatures_M Support for specific card features + ** @brief This is a group for specific card features (Originality checking, MRTD, EMV etc...) + * @{ + */ + /** @defgroup Card_Tag_CardFeatures_OriginalityChecking_M Originality Checking + * @brief Some card chips supports originality checking mechanism using Elliptic Curve Digital Signature Algorithm (ECDSA). Chip families that support originality checking mechanism are NTAG 21x and Mifare Ultralight EV1. + * For details on originality checking, you must have an non-disclosure agreement (NDA) with the manufacturer who will provide you with the relevant documentation. + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_OriginalityChecking_M + + /** @defgroup Card_Tag_CardFeatures_ISO144434_4_M ISO14443-4 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO144434_4_M + + /** @defgroup Card_Tag_CardFeatures_ISO7816_M ISO7816 Protocol + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_ISO7816_M + + /** @defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M General purpose cryptographic functions + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_GeneralPurposeCrypto_M + + /** @defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M Cryptographic hashing algorithms + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_CryptoHashAlgorithms_M + + /** @defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M Digital signature verification + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_DigitalSignatureVerification_M + + /** @defgroup Card_Tag_CardFeatures_MRTD_M Machine Readable Travel Documents (MRTD) support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_MRTD_M + + /** @defgroup Card_Tag_CardFeatures_TLS_M TLS 1.2 with TLS/SSL Client Certificate Authentication using Generic Identity Device Specification (GIDS) smart card support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TLS_M + + /** @defgroup Card_Tag_CardFeatures_EMV_M Europay, Mastercard, Visa (EMV) standard support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_EMV_M + + /** @defgroup Card_Tag_CardFeatures_AntiCollision_M Anti-collision support i.e. multi card reader mode + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_AntiCollision_M + + /** @defgroup Card_Tag_CardFeatures_TransceiveMode_M Transeive mode support + * @{ + */ + /**@}*/ // end of defgroup Card_Tag_CardFeatures_TransceiveMode_M + + /**@}*/ // end of defgroup Card_Tag_CardFeatures_M + + /**@}*/ // end of defgroup Card_Tag_M + + /** @defgroup Miscellaneous_M Miscellaneous + * @{ + */ + /**@}*/ // end of defgroup Miscellaneous_M + + /**@}*/ // end of defgroup MultiReader + + /** @defgroup uFR_MDK uFR MDK (Mobile Development Kit) + * @since uFCoder library version 6.0.0 + * + * Using the internal NFC antenna of a mobile device is supported in the uFCoder library through the usage of ReaderOpenEx() with appropriate parameters. + * It is mandatory to obtain a valid DLogic license to make use of the uFR MDK. + * License can be obtained automatically through the ReaderOpenEx() API call. + * Or using the GetLicenseRequestData() and our online service found at: https://liblic.d-logic.com/
+ * Refer to @ref LibLic group for details. + * + * @{ + */ + /** @defgroup uFR_MDK_Android Android + * @brief uFR MDK for Android currently has support for the NTAG2XX, Mifare Classic®, Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * @{ + */ + /** @defgroup uFR_MDK_Android_NTAG2XX NTAG2XX with NDEF support + * @brief Supported API calls for NTAG2XX (e.g NTAG203/210/213/215/216) cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * read_ndef_record() + * * write_ndef_record() + * * write_ndef_record_mirroring() + * * write_ndef_record_mirroring_tt() + * * get_ndef_record_count() + * * erase_last_ndef_record() + * * erase_all_ndef_records() + * * ndef_card_initialization() + * * WriteNdefRecord_WiFi() + * * WriteNdefRecord_BT() + * * WriteNdefRecord_SMS() + * * WriteNdefRecord_Bitcoin() + * * WriteNdefRecord_GeoLocation() + * * WriteNdefRecord_NaviDestination() + * * WriteNdefRecord_Email() + * * WriteNdefRecord_Address() + * * WriteNdefRecord_AndroidApp() + * * WriteNdefRecord_Text() + * * WriteNdefRecord_StreetView() + * * WriteNdefRecord_Skype() + * * WriteNdefRecord_Whatsapp() + * * WriteNdefRecord_Viber() + * * WriteNdefRecord_Contact() + * * WriteNdefRecord_Phone() + * * ReadNdefRecord_WiFi() + * * ReadNdefRecord_Bitcoin() + * * ReadNdefRecord_GeoLocation() + * * ReadNdefRecord_NaviDestination() + * * ReadNdefRecord_Email() + * * ReadNdefRecord_Address() + * * ReadNdefRecord_AndroidApp() + * * ReadNdefRecord_Text() + * * ReadNdefRecord_StreetView() + * * ReadNdefRecord_Skype() + * * ReadNdefRecord_Whatsapp() + * * ReadNdefRecord_Viber() + * * ReadNdefRecord_Contact() + * * ReadNdefRecord_Phone() + * * ReadNdefRecord_SMS() + * * ReadNdefRecord_BT() + * * ParseNdefMessage() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_NTAG2XX + + /** @defgroup uFR_MDK_Android_Mifare Mifare Classic + * @brief Supported API calls for Mifare Classic cards: + * + * * GetCardIdEx() + * * GetDlogicCardType() + * * BlockRead_PK() + * * BlockInSectorRead_PK() + * * BlockWrite_PK() + * * BlockInSectorWrite_PK() + * * LinearRead_PK() + * * LinearWrite_PK() + * * SectorTrailerWrite_PK() + * * SectorTrailerWriteUnsafe_PK() + * * ValueBlockRead_PK() + * * ValueBlockWrite_PK() + * * ValueBlockInSectorRead_PK() + * * ValueBlockInSectorWrite_PK() + * * ValueBlockIncrement_PK() + * * ValueBlockDecrement_PK() + * * ValueBlockInSectorIncrement_PK() + * * ValueBlockInSectorDecrement_PK() + * * LinearFormatCard_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Mifare + + /** @defgroup uFR_MDK_Android_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth() + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth() + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_Desfire + + /** @defgroup uFR_MDK_Android_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_Android_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_Android + + /** @defgroup uFR_MDK_iOS iOS + * @brief uFR MDK for IOS currently has support only for Mifare DESFire® tags and ISO 14443-4 protocol via APDU commands. + * + * @{ + */ + /** @defgroup uFR_MDK_iOS_Desfire Mifare DESFire + * @brief Supported API calls for Mifare DESFire® cards: + * + * * DES_to_AES_key_type() + * * AES_to_DES_key_type() + * * uFR_int_DesfireFreeMem() + * * uFR_int_DesfireFormatCard_PK() + * * uFR_int_DesfireFormatCard_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_PK() + * * uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK() + * * uFR_int_DesfireDeleteFile_PK() + * * uFR_int_DesfireDeleteFile_aes_PK() + * * uFR_int_DesfireCreateAesApplication_PK() + * * uFR_int_DesfireCreateAesApplication_aes_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_PK() + * * uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK() + * * uFR_int_DesfireDeleteApplication_PK() + * * uFR_int_DesfireDeleteApplication_aes_PK() + * * uFR_int_DesfireGetKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_PK() + * * uFR_int_DesfireChangeKeySettings_aes_PK() + * * uFR_int_DesfireChangeAesKey_aes_PK() + * * uFR_int_DesfireChangeMasterKey_PK() + * * uFR_int_DesfireReadStdDataFile_aes_PK() + * * uFR_int_DesfireReadStdDataFile_no_auth + * * uFR_int_DesfireWriteStdDataFile_aes_PK() + * * uFR_int_DesfireWriteStdDataFile_no_auth + * * uFR_int_DesfireGetStdFileSize_aes_PK() + * * uFR_int_DesfireGetFileSettings_aes_PK() + * * uFR_int_DesfireGetFileSettingsSdm_aes_PK() + * * uFR_int_DesfireChangeFileSettings_aes_PK() + * * uFR_int_DesfireChangeFileSettingsSdm_PK() + * * uFR_int_DesfireSetTransactionTimer_aes_PK() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_iOS_Desfire + + + /** @defgroup uFR_MDK_IOS_ISO14443_4 ISO 14443-4 protocol + * @brief Supported API calls for ISO 14443-4 APDU commands: + * + * * SetISO14443_4_Mode() + * * APDUHexStrTransceive() + * * APDUPlainTransceive() + * * s_block_deselect() + * @{ + */ + /** @}*/ // end of defgroup uFR_MDK_IOS_ISO14443_4 + + /** @}*/ // end of defgroup uFR_MDK_iOS + + /**@}*/ // end of defgroup uFR_MDK + + //-------------------------------------------------------------------------------------------------- + /** + * @brief Used to generate license request necessary for obtaing valid uFCoder license separately. + * + * Parameter "license_request" will hold a JSON string value that is to be used for our online front-end service for generating an offline license. + * The online service is found at: https://liblic.d-logic.com/ + * + * @ingroup LibLic + * + * @param months Number of months requested for the license + * @param license_request JSON string formed with licensing parameters + * + */ + void DL_API GetLicenseRequestData(uint32_t months, OUT char *license_request); + + /** + * @brief Used to validate and store an offline Dlogic license for future usage. + * + * @ingroup LibLic + * + * @param license_str JSON string containing full license data + * + * @return Operation status + */ + UFR_STATUS DL_API SetLicenseData(c_string license_str); + + /** + * @brief Opens reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s. If you have more than one µFR Online device, ReaderOpen function will open the first one found, for the device not connected to the PC via cable, use ReaderOpenEx() instead. + *
+ * NOTE: On Android, using ReaderOpen() will establish communication with uFR Series readers connected via OTG cable. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen(void); + + /** + * @brief Opens a port of connected reader using readers family type. Useful for speed up opening for non uFR basic reader type (e.g. BaseHD with uFR support). + * + * Do not use this function for opening communication with µFR Online devices. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenByType(uint32_t reader_type); + + enum E_READER_TYPE + { + AUTO = 0, + UFR_TYPE = 1, + UFR_RS232_TYPE = 2, + BASEHD_UFR_TYPE = 3, + UFR_ONLINE_TYPE = 4, + INTERNAL_NFC = 5 + }; + + /** + * @brief Open reader communication port in several different ways. Can be used for establishing communication with COM port too. + * + * There is enumeration in uFCoder.h file called E_READER_TYPE with values: + * enum E_READER_TYPE + * { + * AUTO = 0, + * UFR_TYPE = 1, + * UFR_RS232_TYPE = 2, + * BASEHD_UFR_TYPE = 3, + * UFR_ONLINE_TYPE = 4, + * INTERNAL_NFC = 5 + * }; + * Values in this enumeration you can pass into ReaderOpenEx function as reader_type parameter.
+ * For example, if you pass 4 as reader_type it will only work with µFR Online Series devices, and then as port_name you can pass devices IP address or serial number (ex: “192.168.1.123” or “ON101390”), for port_interface you can pass ‘U’ for UDP, ‘T’ for TCP or 0. + * If you pass 0, it will automatically search for reader working mode (UDP or TCP) and open it. For argument you can pass 0 or µFR Nano device serial number to open it on 1Mbit/s (ex: “UN123456”).
+ * Using value 5 as reader_type implies usage of internal mobile device NFC. + * Upon a call to ReaderOpenEx with this parameter, the library will try to obtain license automatically via HTTP. + * On success, a valid license is stored for future use. On failure, it moves to looking up for stored licenses. Results other than UFR_OK status imply a corresponding error that occurred and as such use of internal mobile device NFC will be unavailable. + * When using 5 as reader_type, additionally you can specify port_interface parameter to decide whether to do online->offline validation or just offline. To use offline-only validation of a previously stored valid DLogic license, set port_interface to 1. + * Value 0 is default value for port_interface and implies online->offline license validation. + * More examples for port open are given in the “Reader Open Examples” document: + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-doc/blob/master/Reader_Open_Examples.pdf + * Examples: + * ReaderOpenEx(1, “COM1”, 0, 0) + * This example will open communication with µFR device attached to COM1 port on 1Mbit/s + * ReaderOpenEx(1, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR device on 1Mbit/s + * ReaderOpenEx(2, 0, 0, 0) + * This example will automatically find COM port and open communication with first µFR RS232 device on 115200 bit/s + * ReaderOpenEx(4, “ON123456”, ‘U’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on UDP protocol. + * ReaderOpenEx(4, “ON123456”, ‘T’, 0) + * This example will open communication with µFR Online reader with serial number ON123456 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘U’, 0) + * This example will open communication with µFR Online reader with IP address 192.168.1.123 on UDP protocol. + * ReaderOpenEx(4, “192.168.1.123”, ‘T’, 0) + * This will open communication with µFR Online reader with IP address 192.168.1.123 on TCP protocol. + * ReaderOpenEx(4, “192.168.1.123”, 0, 0) + * It will open communication with µFR Online reader with IP address 192.168.1.123 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, 0) + * It will open communication with µFR Online reader with serial number ON123456 based on its working protocol (UDP or TCP), because we passed 0 as port_interface + * ReaderOpenEx(4, “ON123456”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with serial number ON123456 + * ReaderOpenEx(4, “192.168.1.123”, 0, “UN654321”) + * It will open communication with µFR Nano reader on 1Mbit/s with serial number UN654321 which is attached to µFR Online device with IP address 192.168.1.123 + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 0 : auto - same as call ReaderOpen() 1 : uFR type (1 Mbps) 2 : uFR RS232 type (115200 bps) 3 : BASE HD uFR type (250 Kbps) When uFR Online reader works in BT serial mode or transparent mode, reader_type must be set to 1. + * @param port_name is c-string type used to open port by given serial name. If you provide NULL or empty string that is AUTO MODE which calls ReaderOpenEx() and all available ports on the system. serial port name, identifier, like "COM3" on Windows or "/dev/ttyS0" on Linux or "/dev/tty.serial1" on OS X or if you select FTDI, reader serial number like "UN123456", if reader have integrated FTDI interface When the UDP interface type is selected, port_name must be provided in “address:port” format. Like "192.168.1.162:8881" IP for UDP I/F + * @param port_interface type of communication interfaces (define interface which we use while connecting to the printer), supported value's: 0 : auto - first try FTDI than serial if port_name is not defined 1 : try serial / virtual COM port / interfaces 2 : try only FTDI communication interfaces 10 : try to open Digital Logic Shields with RS232 uFReader on Raspberry Pi (serial interfaces with GPIO reset) 84 ('T') : TCP/IP interface 85 ('U') : UDP interface 102 ('B'): BT serial interface. Android library only. 114 ('L'): BLE interface. Android library only. When uFR Online reader works in BT serial mode, port_interface must be set to 0 (Except Android). arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * @param arg C-string with additional settings delimited with new lines. Settings C-string constant: “UNIT_OPEN_RESET_DISABLE” : do not reset the reader when opening “UNIT_OPEN_RESET_FORCE” : force reset the reader when opening “UNIT_OPEN_RESET_ONLY”: only resets the device and will not send additional commands that are used when establishing communication with the reader. "READER_ACTIVE_ON_RTS_LOW" : (default) Reset the reader when RTS is high - the reader works when RTS is low "READER_ACTIVE_ON_RTS_HIGH" : Reset the reader when RTS is low - the reader works when RTS is high "RTS_ALWAYS_HIGH" : not implemented yet "RTS_ALWAYS_LOW" : not implemented yet "RTS_DISCONNECTED" : disconnect RTS (RTS is not initiate nor use) When uFR Online reader works in BT serial mode or transparent mode, arg must be set to “UNIT_OPEN_RESET_DISABLE”. Custom baud rates from library version 5.0.28. For all RS232 devices and USB devices from firmware version 5.0.31 "BR_1000000" : 1 Mbps "BR_115200" : 115200 bps "BR_250000" : 250000 bps "BR_9600" : 9600 bps "BR_19200" : 19200 bps "BR_38400" : 38400 bps "BR_57600" : 57600 bps "BR_230400" : 234000 bps "BR_460800" : 460800 bps "BR_500000" : 500000 bps + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenEx(uint32_t reader_type, IN c_string port_name, uint32_t port_interface, IN void *arg); + + /** + * @brief Opens uFR Online device by serial number. + * + * Function will open communication (UDP or TCP) with device based on its working mode. If function cannot find given serial number, it will open communication on serial port with 1Mbit/s. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param serial_number Pointer to const char array (c_string) containing devices serial number (ex. “ON101390”). + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpen_uFROnline(c_string serial_number); + + /** + * @brief Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderReset(void); + + /** + * @brief Physical reset of reader communication port & tests the communication before returning a UFR_STATUS code. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetWait(void); + + /** + * @brief Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderClose(void); + + /** + * @brief This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestart(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderHwReset(void); + + /** + * @brief Used to get the FTDI D2XX driver version number. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major: Byte value indicating driver version major number + * @param version_minor: Byte value indicating driver version minor number + * @param build: Byte value indicating driver version build number + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor, VAR uint8_t* build); + + /** + * @brief Used to get the FTDI D2XX driver version number as c-string. The communication with the reader needs to be established via ReaderOpen() or ReaderOpenEx() beforehand. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_str: buffer that will contain driver version as c-string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetFtdiDriverVersionStr(OUT char *version_str); + + /** + * @brief Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderType(VAR uint32_t *lpulReaderType); + + /** + * @brief Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information + * + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumber(VAR uint32_t *lpulSerialNumber); + + /** + * @brief Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information + * + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnected(VAR uint32_t *connected); + + /** + * @brief Store a new key or change existing key under provided index parameter. + * + * The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWrite(IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLock(IN const uint8_t *password); + + /** + * @brief Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlock(IN const uint8_t *password); + + /** + * @brief This function turns sound and light reader signals. + * + * Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignal(uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). + * + * Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolume(uint8_t sound_volume); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserData(OUT uint8_t *aucData); + + /** + * @brief Read user data written in device NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 bytes array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExt(OUT uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 16 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 16 byte array containing user data + * @return Operation status + */ + UFR_STATUS DL_API WriteUserData(IN const uint8_t *aucData); + + /** + * @brief Write user data into the device's NV memory. + * + * User data is 32 byte long. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param aucData pointer to a 32 byte array containing user data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExt(IN const uint8_t *aucData); + + /** + * @brief Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). + * + * We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @ingroup Card_Tag_General + * + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardId(VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * @ingroup Miscellaneous + * + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSak(VAR uint16_t *atqa, VAR uint8_t *sak); + + /** + * @brief Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKey(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular block using absolute Block address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKey(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKey(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Write particular block using relative Block in Sector address. + * + * *only uFR CS with SAM support. + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKey(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKey(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead(OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesReturned, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, VAR uint16_t *lpusBytesWritten, + uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief These functions are used for writing data to the card using emulation of the linear address space. + * The method for proving authenticity is determined by the suffix in the functions names. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKey(IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKey(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKey(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKey(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKey(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKey(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKey(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * *only uFR CS with SAM support + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKey(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute Block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 1 (AKM1) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. + * + * Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2(int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Automatic Key Mode 2 (AKM2) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Provided Key mode (PK) Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PK(OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PK(IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PK(OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PK(IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. + * + * When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read Linear data Address Space. + * + * On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PK(OUT uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_returned, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) These functions are used for writing data to the card using emulation of the linear address space. + * + * The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare + * + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned Pointer to variable holding how many bytes are returned auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param bytes_written Pointer to variable holding how many bytes are written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PK(IN const uint8_t *data, uint16_t linear_address, uint16_t length, VAR uint16_t *bytes_written, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param new_key_B Pointer on 6 bytes array containing a new KeyA lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PK(IN const uint8_t *new_key_A, uint8_t blocks_access_bits, uint8_t sector_trailers_access_bits, + uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, VAR uint8_t *lpucSectorsFormatted, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, uint8_t block0_access_bits, + uint8_t block1_access_bits, uint8_t block2_access_bits, uint8_t sector_trailer_access_bits, + uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. + * + * It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare + * + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 key_index Index of reader’s key to be used (RK mode) key Pointer to 6 byte array containing key bytes (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PK(uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockWrite Function description Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockWrite(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockWrite_AKM1(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_AKM2(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockWrite_PK(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockWriteSamKey(int32_t *value, uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Read particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PK(VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PK(int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Write particular Value block using absolute Block address. + * + * This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PK(int32_t value, uint8_t value_addr, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PK(int32_t increment_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Increments particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param increment_value value showing how much initial block value will be incremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PK(int32_t increment_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using absolute Block address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare + * + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PK(int32_t decrement_value, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information + * + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersion(VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTime(VAR uint8_t *time); + + /** + * @brief Function sets the date and time into the device's RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC + * + * @param password pointer to the 8 bytes array containing password time pointer to the 6 bytes array containing date and time representation + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief This function is used in Common, Advance and Access Control set of functions. + * + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM. Maximal length of array is 128 bytes. + * + * Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * @param password pointer to array containing password Functions that works with Mifare Desfire Card (AES encryption in reader) AES encryption and decryption is performed in the reader. AES keys are stored into reader. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeSector(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API SubscribeBlock(uint8_t block_nr, uint32_t admin_serial); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BusAdminCardMake(uint32_t serial, IN uint8_t *password); + + /** + * @brief Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information + * + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescription(OUT uint8_t pSerialDescription[8]); + + /** + * @brief Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information + * + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumber(VAR uint8_t *build); + + /** + * @brief This function returns UID of card actually present in RF field of reader. It can handle all three known types : 4, 7 and 10 byte long UIDs. + * + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General + * + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdEx(VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi-card (anti collision) mode: + //------------------------------------------------------------------------------ + /** + * @brief This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollision(void); + + /** + * @brief Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollision(void); + + /** + * @brief If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. + * + * Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCards(VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + /** + * @brief For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. + * + * First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * Before calling this function you have to call EnumCards() first. + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCards(OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + /** + * @brief Selects one of the cards which UID is on the actual UID list of the enumerated cards. + * + * If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCard(IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. + * + * Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCard(void); + + /** + * @brief Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision + * + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatus(VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + //------------------------------------------------------------------------------ + /** + * @brief This function returns card type according to DlogicCardType enumeration. + * + * For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General + * + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardType(VAR uint8_t *lpucCardType); + + /** + * @brief This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General + * + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturer(OUT char* card_manufacturer_str); + + /** + * @brief This function returns 8 bytes of the T2T version. + * + * All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersion(OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). + * + * The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General + * + * @param lpulLinearSize pointer to variable which contain size of user data space lpulRawSize pointer to variable which contain size of total data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSize(VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * @ingroup Miscellaneous + * + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatus(OUT uint8_t *tt_message, VAR uint8_t *tt_status); + //------------------------------------------------------------------------------ + /** + * @brief Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. + * + * The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @ingroup Card_Tag + * + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalData(OUT uint8_t data[32], VAR uint32_t *len); + + /** + * @brief Function returns reader’s serialized discovery loop structure. + * + * C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetup(OUT uint8_t *setupStruct, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoop(IN const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Function returns the AID set in the reader to retrieve the mobile phone's unique ID. + * + * If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAid(OUT uint8_t *aid, VAR uint32_t *len); + + /** + * @brief Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures + * + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAid(IN const uint8_t *aid, uint32_t len); + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfig(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtp(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlot(uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfiguration(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKey(void); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencrypted(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKey(uint8_t key_slot, uint8_t pub_key_id[4], uint8_t bool_enabled, + uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZone(uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZone(uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatus(VAR uint8_t *bool_config_zone_locked, VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevision(uint8_t revision[4]); + //------------------------------------------------------------------------------ + + // uFCoder PRO MODE + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProMode(VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProMode(const uint32_t ReaderProMode); + + // QR barcode crypt algorithm + // initialization. with TB serial like 'TB123456' + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_Initialize(IN const uint8_t *TBSerialString, uint16_t job_number); + + // You must define 25 bytes array in memory for out_card_data[] + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCard(const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + enum CARD_ENCRYPTION_CODE_TYPE + { + CODE_TYPE_STANDARD, + CODE_TYPE_GROUP, + CODE_TYPE_DAILY_RANGE, // valid from, but only to_timestamp / every day + }; + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNext(const uint32_t code_type, const uint32_t from_timestamp, const uint32_t to_timestamp, + const uint32_t additional_data_size, IN const uint8_t additional_data[], + VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSN(OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSN(VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSN(OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Function returns TNF, type of record, ID and payload from the NDEF record. + * + * NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_record(uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. + * + * Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, IN uint8_t *id, + IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, VAR uint8_t *card_formated); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. + * + * NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_tt(uint8_t message_nr, IN uint8_t *tnf, IN uint8_t *type_record, IN uint8_t *type_length, + IN uint8_t *id, IN uint8_t *id_length, IN uint8_t *payload, IN uint32_t *payload_length, + VAR uint8_t *card_formated, int use_uid_ascii_mirror, int use_counter_ascii_mirror, + int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. + * + * Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_count(VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, OUT uint8_t *ndef_record_array, + VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_record(uint8_t message_nr); + + /** + * @brief Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF + * + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_records(uint8_t message_nr); + + /** + * @brief Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. + * + * If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initialization(void); + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + /** + * @brief Function stores a message record for NTAG emulation mode into the reader. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdef(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief This function does the same as WriteEmulationNdef() function with the addition of an AAR embedded in to the NDEF message. + * + * AAR stands for “Android Application Record”. AAR is a special type of NDEF record that is used by Google’s Android operating system to signify to an NFC phone that an explicitly defined Android Application which should be used to handle an emulated NFC tag. Android App record will be added as the 2nd NDEF record in the NDEF message. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record type_record pointer to the array containing record type type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param type_record pointer to the array containing record type + * @param type_length length of the record type id pointer to the array containing record ID id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param id pointer to the array containing record ID + * @param id_length length of the record ID payload pointer to the array containing record payload payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload aar pointer to the array containing AAR record aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * @param aar pointer to the array containing AAR record + * @param aar_length length of the AAR record TagEmulationStart Function description Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). In this mode, the reader can only answer to the commands issued by a following library functions: TagEmulationStart(), WriteEmulationNdef(), TagEmulationStop(), GetReaderSerialNumber(), GetReaderSerialDescription(), GetReaderHardwareVersion(), GetReaderFirmwareVersion(), GetBuildNumber() Calls to the other functions in this mode returns following error code: FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefWithAAR(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, uint8_t id_length, + IN uint8_t *payload, uint8_t payload_length, IN uint8_t *aar, uint8_t aar_length); + + /** + * @brief Put the reader permanently in a NDEF tag emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStart(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStop(void); + + /** + * @brief Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStart(void); + + /** + * @brief Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). + * + * uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStart(void); + + /** + * @brief Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStop(void); + + /** + * @brief This function returns current ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParams(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief This command set ad-hoc emulation parameters. + * + * On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 CombinedModeEmulationStart Function description Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. Function declaration (C language) UFR_STATUS CombinedModeEmulationStart(void); Function takes no parameters. ________________ Support for ISO14443-4 protocol + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParams(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode + * + * @param is_field_present value representing whehter field is present (1) or not (0) + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldState(VAR uint8_t *is_field_present); + + /** + * @brief Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommMode(void); + + /** + * @brief The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop(). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommMode(void); + + /** + * @brief Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRam(IN uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM + * + * @param ram_data buffer containing ram data returned + * @param addr address from which to read reader RAM + * @param data_len length of data to read from RAM + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRam(OUT uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Function stores a message record for NTAG emulation mode into the reader in the RAM. + * + * Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRam(uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, + IN uint8_t *id, uint8_t id_length, IN uint8_t *payload, uint32_t payload_length); + + /** + * @brief Put the reader permanently in a NDEF tag in RAM emulation mode. + * + * Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStopRam() function), or by reader reset. Use the function GetReaderStatus to check if the reader is still in emulation mode (maybe the reader was reset for some reason). + * From library version 5.0.31, and firmware version 5.0.31 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartRam(void); + + /** + * @brief Allows the reader permanent exit from a NDEF tag emulation mode. + * + * From library version 5.0.31, and firmware version 5.0.33 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopRam(void); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value sets to 0. + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function enables the 24 bit NFC counter. + * + * Counter increased by the first valid READ command in the NTAG emulation mode, after the external RF field detected. Counter is represented in 6 bytes of ASCII code, when the NDEF message is read. For example if the counter value is 0x56, it will be represented as 000056, at the end of the NDEF message. Position of the counter mirror start byte must be entered as a function parameter. This is the absolute position in the card emulation data array. + * Counter value stays unchangeable. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @param mirror_pos Position in the card emulation data array + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterNonResetEnabled(uint16_t mirror_pos); + + /** + * @brief Function disables the NFC counter in the card emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationMirrorCounterDisabled(void); + + //------------------------------------------------------------------------------ + + // GetNfcT2TVersion() returns 8 bytes (see T2T documentation): + typedef struct t2t_version_struct + { + uint8_t header; + uint8_t vendor_id; + uint8_t product_type; + uint8_t product_subtype; + uint8_t major_product_version; + uint8_t minor_product_version; + uint8_t storage_size; + uint8_t protocol_type; + } t2t_version_t; + + // NfcT2TSafeConvertVersion() returns converts version_record that returned from GetNfcT2TVersion() + // or GetNfcT2TVersionM(). Conversion is "alignment safe" + // (you don't need to pay attention on structure byte alignment): + /** + * @brief This is a helper function for converting raw array of 8 bytes received by calling GetNfcT2TVersion(). + * + * All modern T2T chips having same or very similar structure of the T2T version data represented in the uFR API by the structure type t2t_version_t: + * typedef struct t2t_version_struct { + * uint8_t header; + * uint8_t vendor_id; + * uint8_t product_type; + * uint8_t product_subtype; + * uint8_t major_product_version; + * uint8_t minor_product_version; + * uint8_t storage_size; + * uint8_t protocol_type; + * } t2t_version_t; + * This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). Conversion done by this function is "alignment safe". + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param version pointer to the structure of the t2t_version_t type which will receive converted T2T version + * @param version_record pointer to array containing 8 bytes of the raw T2T version acquired using function GetNfcT2TVersion() + * + */ + void DL_API NfcT2TSafeConvertVersion(t2t_version_t *version, const uint8_t *version_record); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignature(OUT uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], VAR uint8_t *lpucUidLen, + VAR uint8_t *lpucDlogicCardType); + + /** + * @brief This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExt(OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + /** + * @brief This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounter(uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. + * + * Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounter(uint8_t counter_address, uint32_t inc_value); + + /** + * @brief This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. + * + * If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounter(VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RK(VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Provided Key mode (PK) This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. + * + * If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX + * + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PK(VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfig(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigEx(uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfig(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigEx(VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, VAR uint8_t *suffix, + VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only. Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode idle mode value + * @param card_detection_mode card detection mode value + * @param idle_color idle color value(RGB) + * @param card_detection_color card detection color value(RGB) + * @param enabled enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfig(uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only. Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param idle_mode pointer to idle mode value + * @param card_detection_mode pointer to card detection mode value + * @param idle_color pointer to idle color value(RGB) + * @param card_detection_color pointer to card detection color value(RGB) + * @param enabled pointer to enabled flag + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfig(uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_number(VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, uint8_t start_hour, + uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record(uint8_t record_number, VAR uint16_t *first_reader_nr, VAR uint16_t *last_reader_nr, + VAR uint8_t *start_hour, VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_record(uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_record(uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, uint8_t begin_hour, + uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, uint8_t end_hour, + uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_record(VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, VAR uint8_t *end_month, + VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_type(uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_type(VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_duration(uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_duration(VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_duration(uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_duration(VAR uint32_t *duration); + + // swimming pool ************************************************************** + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validity(VAR int32_t *credit, VAR uint32_t *begin_year, VAR uint32_t *begin_month, + VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, + VAR uint32_t *end_year, VAR uint32_t *end_month, VAR uint32_t *end_day, + VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validity(int32_t credit, uint32_t begin_year, uint32_t begin_month, uint32_t begin_day, + uint32_t begin_hour, + uint32_t begin_minute, + uint32_t end_year, uint32_t end_month, uint32_t end_day, uint32_t end_hour, + uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_record(uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_record(uint8_t record_number, VAR uint8_t *right_record_type, OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counter(uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, + uint8_t end_minute, IN uint8_t *days, uint8_t max_daily_counter); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_record_type_max_daily_counter(uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, + VAR uint8_t *start_minute, VAR uint8_t *end_hour, VAR uint8_t *end_minute, + OUT uint8_t *days, VAR uint8_t *max_daily_counter); + + //============================================================================= + + /** + * @brief Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOn(uint16_t pulse_duration); + + /** + * @brief Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayState(uint8_t state); + + /** + * @brief Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param intercom shows that there is voltage at the terminals for intercom connection, or notss + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoState(VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControl(uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Function gets the state of the input pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR + * + * @param input_nr ordinal number of hardware specific input pin input_state input state 1 or 0. + * @param input_state input state 1 or 0. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetInputState(uint8_t input_nr, VAR uint8_t *input_state); + + /** + * @brief This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControl(uint8_t light_status); + + /** + * @brief For classic uFR PLUS devices only. The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. + * + * This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControl(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Sets the color of the RGB diodes. + * + * This color stays on the RGB diodes until the function GreenLedBlinkingTurnOn() is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity(). + * Before this function call, the function GreenLedBlinkingTurnOff() must be called, or the reader is already in mode of blocking automatic signalization. + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControl(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControl(uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes. + * + * This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleep(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. + * + * In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. + * Function also sets the number of omitted activity periods, when the RGB light is off. + * For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriod(uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSet(uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefault(void); + + /** + * @brief The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. + * + * Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMax(uint8_t bad_select_nr_max); + + /** + * @brief The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary + * + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMax(VAR uint8_t *bad_select_nr_max); + + /** + * @brief Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepMode(void); + + /** + * @brief Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepMode(void); + + /** + * @brief Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSet(uint8_t seconds_wait); + + /** + * @brief Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep + * + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGet(VAR uint8_t *seconds_wait); + + /** + * @brief This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanently(unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParameters(VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. + * + * Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. + * The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. + * For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayData(IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Function has the same functionality as the function SetDisplayData(). New feature is the RGB port selection. + * + * Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbData(IN uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequency(uint16_t frequency); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * SetRgbIntensity()(alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * GetRgbIntensity (alias from version 5.0.55) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensity(VAR uint8_t *intensity); + + /** + * @brief Function sets the intensity of light on the display. + * + * Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbIntensity(uint8_t intensity); + + /** + * @brief Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_RGBSignalization + * + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRgbIntensity(VAR uint8_t *intensity); + // DESFIRE functions ************************************************************** + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode(void); + + /** + * @brief Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATS(OUT uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorage(void); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceive(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint32_t *ufr_status); + + /** + * @brief Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Transceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, uint8_t data_out_len, + OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, uint8_t send_le, + OUT uint8_t *apdu_status); + + /** + * @brief Sends C–APDU in the c_string (zero terminated) format, containing pairs of the hexadecimal digits. + * + * Pairs of the hexadecimal digits can be delimited by any of the punctuation characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu C-APDU hexadecimal c_string + * @param r_apdu Received R-APDU as a hexadecimal c_string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceive(IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are sent and receive in the form of the byte arrays. + * + * There is obvious need for a c_apdu_len and *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceive(IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * @ingroup UNDOCUMENTED + * + * @param c_apdu array containing C_APDU + * @param c_apdu_len length of C_APDU + * @param r_apdu buffer that will store R_APDU + * @param r_apdu_len returns length of R_APDU + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeap(IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief This is “exploded binary” alternative function intended for support APDU commands in ISO 14443-4A tags. + * APDUTransceive() receives separated parameters which are an integral part of the C– APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param cls cls + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceive(uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, uint32_t Nc, + OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chain(uint8_t chaining, uint8_t timeout, uint8_t block_length, IN uint8_t *snd_data_array, + VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, VAR uint8_t *rcv_chained, + VAR uint32_t *ufr_status); + + /** + * @brief R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceive(uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4 + * + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselect(uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * @ingroup UNDOCUMENTED + * + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive(uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, uint8_t crypto1, + uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Function sets the parameters for transceive mode. + * + * If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_start(uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stop(void); + + /** + * @brief Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enable(void); + + /** + * @brief The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode + * + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending rcv_data pointer to data array received from card bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card rcv_len number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceive(IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, uint32_t bytes_to_receive, + VAR uint32_t *rcv_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interface(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_Generic(OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interface(void); + + /** + * @brief Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDU(void); + + /** + * @brief Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4(void); + + /** + * @brief Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interface(void); + + /** + * @brief APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816 + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interface(void); + + //============================================================================== + /** + * @brief Using this function you can select the appropriate application on the card. + * + * For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAid(IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief In JCApp cards you can put two types of asymmetric crypto keys. + * + * Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKey(uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + IN const uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPair(uint8_t key_type, uint8_t key_index, uint8_t key_designator, uint16_t key_bit_len, + IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPair(uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPair(uint8_t key_index); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBegin(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *chunk, + uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdate(IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEnd(VAR uint16_t *sig_len); + + /** + * @brief This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignature(uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, IN const uint8_t *plain_data, + uint16_t plain_data_len, VAR uint16_t *sig_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Finally, to get a signature, you have to call JCAppGetSignature(). + * + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior calling of this function you have to be logged in with an User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param sig Pointer to an array of “sig_len” bytes length. Value of the “sig_len” you've got as a parameter of the JCAppSignatureEnd() or JCAppGenerateSignature() functions. You have to allocate those bytes before calling this function. + * @param sig_len Length of the allocated bytes in a sig array. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetSignature(OUT uint8_t *sig, uint16_t sig_len); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObj(uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, uint8_t id_size); + + /** + * @brief Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubject(uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Using this function you can delete certificate objects from a card. + * + * This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCert(uint8_t obj_type, uint8_t obj_index); + + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjId(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubject(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + /** + * @brief This function you always have to call 2 times. + * + * Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObj(uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + /** + * + * @ingroup Card_Tag_JavaCardApplication + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + c_string DL_API JCAppGetErrorDescription(UFR_STATUS apdu_error_status); + + /** + * @brief This function is used to login to the JCApp with an appropriate PIN code. + * + * Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. JCAppGetPinTriesRemaining Function description This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. This function have parameter of the type dl_sec_code_t which is defined as: typedef enum { USER_PIN = 0, SO_PIN, USER_PUK, SO_PUK } dl_sec_code_t; + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLogin(uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemaining(dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t. + * + * Which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code. + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChange(dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief This function is used to unblock PIN code which is specified by the SO parameter. + * + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common + * + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblock(uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common + * @ingroup UNDOCUMENTED + * + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisable(uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKey(uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, OUT uint8_t *exponent, + VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKey( + uint8_t key_index, OUT uint8_t *keyW, + VAR uint16_t *keyWSize, + OUT uint8_t *field, VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, VAR uint16_t *g_size, + OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature + * @ingroup UNDOCUMENTED + * + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBits(uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + //------------------------------------------------------------------------------ + /** + * @brief This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. + * + * Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list_size ointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSize(VAR uint32_t *list_size); + + /** + * @brief After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFiles(OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief This function returns file size indexed by the parameter card_file_index, on successful execution. + * + * Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file which size we want to get. + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSize(uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. + * + * On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFile(uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief This function reads a file from the DLStorage card directly to the new file on the host file-system. + * + * If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. + * + * Parameter data_size defines the amount of data to be written in the file on the DLStorage card. + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFile(uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief This function writes file content from the host file-system to the new file on the DLStorage card. + * + * If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystem(uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief After successful call to this function, the file on the DLStorage card will be deleted. + * + * Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage + * + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFile(uint8_t file_index); + //------------------------------------------------------------------------------ + /** + * @brief This function is used to get hash output length in bytes for specified hash algorithms. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator for which we want to get output length in bytes. Use values declared in E_HASH_ALGS enumeration. + * @param out_byte_len After successful function execution, the variable on which this pointer points to, will contain output hash length in bytes for specified hash algorithm. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashOutputByteLength(uint32_t hash_algo, VAR uint32_t *out_byte_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions) + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHash(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, OUT uint8_t *hash, uint32_t hash_alocated); + + /** + * @brief This function calculates and returns the hash of the data in the buffer pointed by the “in” function parameter. + * + * Hash algorithm is specified by the hash_algo function parameter. + * If output bytes don't match with hash_alocated function parameter function returns CRYPTO_SUBSYS_WRONG_HASH_OUTPUT_LENGTH status. + * GetHashToHeap() automatically allocates memory, which *hash parameter will point to after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used for calculation. Use values declared in E_HASH_ALGS enumeration. + * @param in Input buffer of which hash is calculated. + * @param in_len Input buffer length in bytes. Maximum buffer length is 32 KB. If you have more data, use the chunked hashing method (see usage instructions of the DLHashInitChunked(), DLHashUpdateChunked() and DLHashFinishChunked() functions). + * @param hash After successful function execution, the variable on which this pointer points to, will contain the pointer to the output hash. + * @param hash_len After successful function execution, the variable on which this pointer points to, will contain output hash length. + * + * @return Operation status + */ + UFR_STATUS DL_API DLGetHashToHeap(uint32_t hash_algo, IN const uint8_t *in, uint32_t in_len, VAR uint8_t **hash, VAR uint32_t *hash_len); + + /** + * @brief This function is used in conjunction with DLHashUpdateChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() has to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash_algo Hash designator which specifies the hash algorithm used in the following hashing sequence. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashInitChunked(uint32_t hash_algo); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param in One of the chunks of data of which hash is calculated. + * @param in_len Chunk length in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashUpdateChunked(IN const uint8_t *in, uint32_t in_len); + + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunked(OUT uint8_t *hash, uint32_t hash_alocated); + /** + * @brief This function is used in conjunction with DLHashInitChunked() and DLHashUpdateChunked() functions. + * + * These functions have the same result as the single call to DLGetHash() or DLGetHashToHeap() functions but they are used for larger amounts of data to hash. + * These functions have to be called in the specific sequence. Disruption of the calling sequence leads to unpredictable results. In every hashing sequence, DLHashInitChunked() have to be called exactly once, in the beginning of the sequence. After successful hashing sequence initialization, there can be as many as needed DLHashUpdateChunked() calls. Chunk sizes may vary throughout the sequence. At the end of the sequence there can be exactly one call to either DLHashFinishChunked() or DLHashFinishChunkedToHeap() function. These two functions differ only in that the DLHashFinishChunkedToHeap() automatically allocates space for a resulting hash while the DLHashFinishChunked() expects to store the result in an already allocated memory on the heap. Calling one of DLHashFinishChunked() or DLHashFinishChunkedToHeap() functions finishes the current hashing sequence. + * DLHashFinishChunkedToHeap() automatically allocates memory, which *hash parameter will point to, after successful execution. User is obligated to cleanup allocated memory space, occupied by the *hash, after use (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param hash After successful function execution, the variable on which this pointer points to, will contain output of the hashing sequence. + * @param hash_alocated This parameter should contain the number of bytes previously allocated in the hash buffer. This parameter have to be greater or equal to the output length of the hash algorithm which is specified by the hash_algo parameter passed in the previous call to the DLHashInitChunked(), in the beginning of the hashing sequence. + * + * @return Operation status + */ + UFR_STATUS DL_API DLHashFinishChunkedToHeap(OUT uint8_t **hash, VAR uint32_t *hash_alocated); + + /** + * @brief This function is used to verify the digital signature of the pre-hashed value or some relatively short plain text message. + * + * If there is no errors during the verification process and digital signature correspond to the "To Be Signed" (TBS) data array and public cryptographic key, the function returns UFR_OK status. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * In case of wrong digital signature, function returns CRYPTO_SUBSYS_WRONG_SIGNATURE status. + * Function can return following status codes in case of various errors: + * * CRYPTO_SUBSYS_NOT_INITIALIZED + * * CRYPTO_SUBSYS_INVALID_HASH_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_PADDING_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_CIPHER_ALGORITHM + * * CRYPTO_SUBSYS_INVALID_SIGNATURE_PARAMS + * * CRYPTO_SUBSYS_INVALID_RSA_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY + * * CRYPTO_SUBSYS_INVALID_ECC_PUB_KEY_PARAMS + * * CRYPTO_SUBSYS_UNKNOWN_ECC_CURVE + * * CRYPTO_SUBSYS_SIGNATURE_VERIFICATION_ERROR + * For digest_alg use one of the values declared in E_SIGNER_DIGESTS enumeration: + * enum E_SIGNER_DIGESTS { + * ALG_NULL = 0, + * ALG_SHA, + * ALG_SHA_256, + * ALG_SHA_384, + * ALG_SHA_512, + * ALG_SHA_224, + * ALG_SHA_512_224, + * ALG_SHA_512_256, + * SIG_DIGEST_MAX_SUPPORTED + * }; + * ALG_SHA is the designator for the SHA-1 algorithm. + * For padding_alg use one of the values declared in E_SIGNER_RSA_PADDINGS enumeration: + * enum E_SIGNER_RSA_PADDINGS { + * PAD_NULL = 0, + * PAD_PKCS1_V1_5, + * PAD_PKCS1_PSS, + * SIG_PAD_MAX_SUPPORTED + * }; + * PAD_PKCS1 is an alias of the PAD_PKCS1_V1_5 padding algorithm: + * #define PAD_PKCS1 PAD_PKCS1_V1_5 + * For cipher_alg use one of the values declared in E_SIGNER_CIPHERS enumeration: + * enum E_SIGNER_CIPHERS { + * SIG_CIPHER_RSA = 0, + * SIG_CIPHER_ECDSA, + * SIG_CIPHER_MAX_SUPPORTED + * }; + * When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * + * @ingroup Card_Tag_CardFeatures_DigitalSignatureVerification + * + * @param digest_alg in the E_SIGNER_DIGESTS enumeration. + * @param padding_alg in the E_SIGNER_RSA_PADDINGS enumeration. When the signer cipher algorithm is SIG_CIPHER_ECDSA, padding_alg is ignored and you can freely use PAD_NULL i.e. value 0 as a padding_alg. ECDSA data alignment in use is described in RFC6979 (section 2.3. - Integer Conversions). + * @param cypher_alg in the E_SIGNER_CIPHERS enumeration. tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param tbs Pointer to the “To Be Signed“ data array i.e. hash or relatively short plain text message whose digital signature is being verified. "To Be Signed" is just a colloquial term for already signed data, which is the origin of the digital signature. + * @param tbs_len Length of the “To Be Signed“ array (in bytes). signature Pointer to the signature array. signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param signature Pointer to the signature array. + * @param signature_len Length of the signature array (in bytes). sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param sig_params Pointer to the additional signature parameters. Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this pointer should point to the unsigned 4-byte integer containing the value of the cryptographic salt length. + * @param sig_params_len Length of the additional signature parameters (in bytes). Additional signature parameters are in use only when padding_alg is PAD_PKCS1_PSS and in that case this value should be 4 i.e. size of unsigned 4-byte integer. In other cases this parameter is ignored. pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key Pointer to the public key array. In the case of the RSA public key, this array should contain key modulus (‘N’). + * @param pub_key_len Length of the public key parameter pub_key (in bytes). pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. pub_key_params_len Length of the additional public key parameters (in bytes). + * @param pub_key_params Pointer to the additional public key parameters. In the case of the RSA public key, this array should contain a public key exponent array (‘e’). In the case of the ECC public key, this array should contain an elliptic curve definition array. To set an elliptic curve definition array you can use SetEllipticCurveByIndex() or SetEllipticCurveByName() functions. + * @param pub_key_params_len Length of the additional public key parameters (in bytes). + * + * @return Operation status + */ + UFR_STATUS DL_API DigitalSignatureVerifyHash(uint32_t digest_alg, uint32_t padding_alg, uint32_t cypher_alg, IN const uint8_t *tbs, + uint32_t tbs_len, IN const uint8_t *signature, uint32_t signature_len, + IN const void *sig_params, uint32_t sig_params_len, IN const uint8_t *pub_key, + uint32_t pub_key_len, IN const void *pub_key_params, uint32_t pub_key_params_len); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the hash algorithm designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param hash_algo Hash designator. Use values declared in E_HASH_ALGS enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetHashName(uint32_t hash_algo); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the ECC curve designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param eccCurve ECC curve designator. Use values declared in E_ECC_CURVES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetEccCurveName(uint32_t eccCurve); + + /** + * @brief This function returns pointer to a null terminated string constant which contains the name of the signature scheme (signature algorithm) designated by the input function parameter. + * + * @ingroup Card_Tag_CardFeatures_GeneralPurposeCrypto + * + * @param signatureScheme Signature scheme (signature algorithm) designator. Use values declared in E_SIGNATURE_SCHEMES enumeration. + * + * @return Operation status + */ + c_string DL_API DLGetSignatureSchemeName(uint32_t signatureScheme); + + /** + * @brief Release the memory allocated from some of the library functions previously called making it available again for further allocations. + * + * Use to deallocate i.e. cleanup memory on the heap allocated. This function is a so-called helper for programming languages other than C/C++ where you can use a free(ptr) instead. Use only after calling the library functions for which it is explicitly indicated in this manual. Function returns nothing. After successful function execution ptr will point to NULL. + * + * @ingroup Card_Tag_CardFeatures_CryptoHashAlgorithms + * + * @param ptr Pointer to the memory allocated on the heap which you want to release. If ptr does not point to a block of memory allocated with the library functions, it causes undefined behavior. If ptr is NULL, the function does nothing. Digital signature verification Enumerations, types and structures for use with DigitalSignatureVerifyHash function enum E_ECC_CURVE_DEFINITION_TYPES { ECC_CURVE_INDEX, ECC_CURVE_NAME, ECC_CURVE_DOMAIN_PARAMETERS, ECC_CURVE_DEFINITION_TYPES_NUM }; + * + */ + void DL_API DLFree(void *ptr); + //------------------------------------------------------------------------------ + /** + * @brief Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBac(IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], + VAR uint64_t *send_sequence_cnt); + + /** + * @brief Use this function to read files from the eMRTD NFC tag. + * + * You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param file_index Parameter that specifies the file we want to read from the eMRTD. This is a pointer to byte array containing exactly two bytes designating eMRTD file. Those two bytes are file identificator (FID) and there is a list of FIDs: EF.COM = {0x01, 0x1E} EF.DG1 = {0x01, 0x01} EF.DG2 = {0x01, 0x02} EF.DG3 = {0x01, 0x03} EF.DG4 = {0x01, 0x04} EF.DG5 = {0x01, 0x05} EF.DG6 = {0x01, 0x06} EF.DG7 = {0x01, 0x07} EF.DG8 = {0x01, 0x08} EF.DG9 = {0x01, 0x09} EF.DG10 = {0x01, 0x0A} EF.DG11 = {0x01, 0x0B} EF.DG12 = {0x01, 0x0C} EF.DG13 = {0x01, 0x0D} EF.DG14 = {0x01, 0x0E} EF.DG15 = {0x01, 0x0F} EF.DG16 = {0x01, 0x10} EF.SOD = {0x01, 0x1D} + * @param output After the successful call to this function, this pointer will point to the pointer on the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated during function execution. Maximum amount of data allocated can be 32KB. There is a programmer responsibility to cleanup allocated data (e.g. by calling DLFree(cert) or directly free(cert) from the C/C++ code). + * @param output_length After the successful call to this function, this pointer is pointed to the size of the file data read from an eMRTD file specified by the file_index parameter. + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeap(IN const uint8_t file_index[2], VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief This function validates data groups read from the eMRTDocument. + * + * All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function.\ + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidate(IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, uint32_t verbose_level, + OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, you can call this function and pass it null terminated strings containing document number, document holder date of birth and document expiration date. + * + * After successful function execution MRZ Proto Key will be stored in a mrz_proto_key 25-byte array. + * + * @ingroup Card_Tag_CardFeatures_MRTD + * + * @param doc_number Pointer to a null terminated string containing exactly 9 characters document number. + * @param date_of_birth Pointer to a null terminated string containing exactly 6 characters representing the date of birth in the “YYMMDD” format. + * @param date_of_expiry Pointer to a null terminated string containing exactly 6 characters representing expiration date in the “YYMMDD” format. + * @param mrz_proto_key This byte array will contain a calculated MRZ proto-key after successful function execution. This array must have allocated at least 25 bytes prior to calling this function. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTD_MRZDataToMRZProtoKey(IN const char *doc_number, IN const char *date_of_birth, IN const char *date_of_expiry, + OUT uint8_t mrz_proto_key[25]); + + /** + * @brief In order to get the MRZ Proto Key needed in subsequent steps, in the case of the TD3 MRZ format (88 totally character long), you can call this function and pass it a null terminated string containing the MRZ subjacent row. + * + * Example of the TD3 MRZ format printed on the eMRTD document looks like this: + * P File 2, and overwrites the contents with data provided + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param data Array containing NDEF message data stored in a buffer to be written + * @param data_length length of the data to be written + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFMessage(IN uint8_t *data, uint32_t data_length); + + /** + * @brief Function used to read the whole NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param message pointer to array that will hold message data + * @param message_length length of the message that was read if successfull + * + * @return Operation status + */ + + UFR_STATUS DL_API uFR_int_DesfireReadNDEFMessage(OUT uint8_t* message, uint32_t *message_length); + /** + * @brief Function used to extract the payload of the NDEF message stored on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * @param payload_str pointer to buffer that will hold payload data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadNDEFPayload(OUT char* payload_str); + + /** + * @brief Function used to write the payload of the NDEF message on the Desfire card + * + * @ingroup Card_Tag_Mifare_Desfire + * + * The function takes in only c-string URI, and sets it's uri_identifier to 0 so it is not prefixed by anything when read. + * + * @param payload_str pointer to buffer that will hold message data + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteNDEFPayload(IN c_string payload_str); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief The function allows the blinking of the green diode independently of the user's signaling command (default setting). + * + * This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOn(void); + + /** + * @brief The function prohibits the blinking of the green diode independently of the user's signaling command. + * + * LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOff(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOn(void); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOff(void); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeA(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeB(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Allow user to adjust the value of several registers on PN512. + * + * These are registers: RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefault(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212Default(void); + + /** + * @brief The functions set the factory default settings of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424Default(void); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeA(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeB(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief The functions read the value of the registers RFCfgReg and RxThresholdReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t CWGsNOff, + uint8_t ModGsNOff); + + /** + * @brief Functions allow adjusting values of registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTrans(uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, uint8_t RxGain, + uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief The functions read the value of the registers RFCfgReg, RxThresholdReg, GsNOnReg, GsNOffReg, CWGsPReg, ModGsPReg. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings + * + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTrans(VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, VAR uint8_t *RFLevelAmp, + VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, VAR uint8_t *ModGsNOn, + VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API FastFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheck(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParameters(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrate(OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API GetReaderParametersPN7462(OUT uint8_t *die_id, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, VAR uint8_t *fw_ver_build); + + // SAM + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_raw(OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version(VAR SAM_HW_TYPE *sam_type, OUT uint8_t *sam_uid); + + /** + * @brief Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_raw(uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param key_no key_no + * @param key_v key_v + * @param des_key des_key + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_des(uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * @ingroup UNDOCUMENTED + * + * @param aes_key_ver_a aes_key_ver_a + * @param ver_a ver_a + * @param aes_key_ver_b aes_key_ver_b + * @param ver_b ver_b + * @param aes_key_ver_c aes_key_ver_c + * @param ver_c ver_c + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_key(IN uint8_t *aes_key_ver_a, uint8_t ver_a, IN uint8_t *aes_key_ver_b, + uint8_t ver_b, IN uint8_t *aes_key_ver_c, uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * @ingroup UNDOCUMENTED + * + * @param master_aes_key master_aes_key + * @param key_version key_version + * @param apdu_sw apdu_sw + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_mode(IN uint8_t *master_aes_key, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. + * + * A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plain(IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *keyA, IN uint8_t *keyB, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Ultralight C card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing 2K3DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST containing DES key for authentication to Mifare Desfire card. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 8 bytes of DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_DES_AV2_plain_one_key(uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_key(uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + uint8_t sam_lock_unlock, uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM + * + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKey(uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeable(void); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfReset(void); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOn(void); + + /** + * @brief Function switch off RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderId(IN uint8_t *reader_id); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReader(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderUsb(IN uint8_t *data, uint16_t packet_nr, uint8_t init_cmd, VAR uint8_t *crc_ok); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API ProgReaderStreamUsb(IN uint8_t *data, uint16_t packet_nr); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BootReader(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_CodeProtect(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParams(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_WriteParamsUsb(IN uint8_t *aes_key, IN uint8_t *serial_nr, uint8_t hw_type, uint8_t hw_ver, IN uint8_t *dev_type, uint8_t production); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_Test(uint8_t param); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdCalibration(uint8_t lpcd_threshold, OUT uint16_t *lpcd_reference); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_LpcdPerform(uint8_t lpcd_threshold, uint16_t lpcd_reference, VAR uint16_t *lpcd_agc, VAR uint8_t *lpcd_status); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOff(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_RfOn(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ExtField(void); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API PN7462_ESP32_boot_init(IN uint8_t *reader_cnt, uint8_t reader_nr); + + // MIFARE PLUS + /** + * @brief Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePerso(uint16_t address, IN uint8_t *data); + + /** + * @brief Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPerso(void); + + /** + * @brief Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param card_master_key card_master_key + * @param card_config_key card_config_key + * @param level_2_switch_key level_2_switch_key + * @param level_3_switch_key level_3_switch_key + * @param level_1_auth_key level_1_auth_key + * @param select_vc_key select_vc_key + * @param prox_chk_key prox_chk_key + * @param vc_poll_enc_key vc_poll_enc_key + * @param vc_poll_mac_key vc_poll_mac_key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimal(IN uint8_t *card_master_key, IN uint8_t *card_config_key, IN uint8_t *level_2_switch_key, + IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, IN uint8_t *select_vc_key, + IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key); + + /** + * @brief Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1(uint8_t key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PK(IN uint8_t *aes_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current master key *new key pointer to 16 byte array containing the new master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current master key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new master key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey(uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PK(IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index key index from which the new configuration key will be set (0 - 15) or in SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKey(uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) *configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PK(IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKey(uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Key B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B auth_mode_pk MIFARE_PLUS_AES_AUTHENT1A for Key A or MIFARE_PLUS_AES_AUTHENT1B for Key B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param key_index key_index + * @param new_key_index new_key_index + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKey(uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, uint8_t new_key_index, uint8_t new_key_type); + + /** + * @brief + * ADD DESCRIPTION + * @ingroup Card_Tag_Mifare_Plus + * @ingroup UNDOCUMENTED + * + * @param sector_nr sector_nr + * @param auth_mode auth_mode + * @param old_key old_key + * @param new_key new_key + * @param new_key_type new_key_type + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PK(uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, uint8_t new_key_type); + + /** + * @brief Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key_index_vc_poll_enc_key ordinary number of VC polling ENC key stored into reader (0 - 15) + * @param key_index_vc_poll_mac_key ordinary number of VC polling MAC key stored into reader (0 - 15) + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKey(uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PK(IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey(uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key_index pointer to 16 byte array containing card configuration key + * @param new_key_index pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKey(uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief + * Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PK(IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief + * Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Mifare_Plus + * + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PK(IN uint8_t *key); + + /** + * @brief No authentication. Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_auth(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_key(IN uint8_t *new_3des_key); + + /** + * @brief Write key into the card. + * + * @ingroup Card_Tag_Ultralight_C + * + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key(IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceGet(uint32_t auth_mode, IN void *auth_value, VAR int32_t *credit); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API BalanceSet(uint32_t auth_mode, IN void *auth_value, int32_t credit); + + /** + * @brief This function sets communication speed (UART baud rate). + * + * Allowed values of baud rate are: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, and 1000000 bps. All RS232 devices are supported, and USB devices (Nano FR, Classic) from firmware version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param baud_rate UART baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API SetUartSpeed(uint32_t baud_rate); + + /** + * @brief This function returns communication speed (UART baud rate) to default value. + * + * For RS23 devices default communication speed is 115200 bps, and for USB devices is 1000000 bps. + * For RS232 devices from version 5.0.1 (plus devices), and for USB devices from version 5.0.31. + * + * @ingroup ReaderAndLibrary_Communication + * + * @param reader_type 1 - USB 2 - RS232 + * @param comm_type 1 - COM port 2 - FTDI + * @param port_name If comm_type is FTDI enter empty string If comm_type is COM port Windows “COMx” Linux “/dev/ttyUSBx” Mac OS “/dev/tty.usbserial-xxxxxxxx” + * + * @return Operation status + */ + UFR_STATUS DL_API SetDefaultUartSpeed(uint8_t reader_type, uint8_t comm_type, IN c_string port_name); + + // NT4H + /** + * @brief Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. + * + * This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parameters(uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Provided Key mode (PK) The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief The function changes the access parameters of an existing standard data file. + * + * The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit read_ctr_limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Provided Key mode (PK) Function enables card Random ID. + * + * Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pk(IN uint8_t *aes_key_ext); + UFR_STATUS DL_API nt4h_unset_rid_pk(IN uint8_t *aes_key_ext); + + /** + * @brief Function enables card Random ID. Authentication with application master key (key number 0) required. + * + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid(uint8_t aes_key_no); + + /** + * @brief Provided Key mode (PK) Function returns card UID if Random ID activated. + * + * Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no ordinal number of AES key into reader (0 - 15) + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid(uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Provided Key mode (PK) Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pk(IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Function changes AES key. + * + * Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key(uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Provided Key mode (PK) Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pk(IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr(uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief No authentication. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_auth(uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Helper function for the MAC of SDM checking. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param mac_in_data data from mac_input_offset to mac_offset + * @param mac_in_len mac_input_offset - mac_offset + * @param sdm_mac pointer to array contained 8 bytes SDM MAC + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_check_sdm_mac(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *mac_in_data, IN uint8_t mac_in_len, IN uint8_t *sdm_mac); + + /** + * @brief Helper function for decryption of encrypted file data. + * + * Users need to know the SDM counter, UID and AES key for file data read. + * + * @ingroup Card_Tag_NT4H + * + * @param smd_read_counter value of SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param auth_key pointer to array contained AES meta data read key + * @param enc_file_data pointer to array contained encrypted part of file data + * @param enc_file_data_len length of encrypted part of file data + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_sdm_enc_file_data(uint32_t smd_read_counter, IN uint8_t *uid, IN uint8_t *auth_key, IN uint8_t *enc_file_data, IN uint8_t enc_file_data_len); + + /** + * @brief Helper function for decryption of encrypted PICC data. + * + * Function returns UID and SDM reading counter. Users need to know the AES key for metadata read (PICC data). + * + * @ingroup Card_Tag_NT4H + * + * @param picc_data pointer to array contained encrypted PICC data + * @param auth_key pointer to array contained AES meta data read key + * @param picc_data_tag if bit 7 set exist UID mirroring if bit 6 set exist SDM reading counter + * @param uid pointer to array contained 7 bytes UID + * @param smd_read_cnt pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_decrypt_picc_data(IN uint8_t *picc_data, IN uint8_t *auth_key, IN uint8_t *picc_data_tag, IN uint8_t *uid, IN uint32_t *smd_read_cnt); + + /** + * Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. + * + * Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * @brief Function returns file settings. + * + * @ingroup Card_Tag_NT4H + * + * @param file_no 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pk(IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H + * + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature(uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pk(IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status(uint8_t aes_key_no, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H + * + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_auth(VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_ext ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pk(IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H + * + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt(uint8_t aes_key_no, uint8_t tt_status_key_no); + + // Desfire light + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param file_type file type 0 - standard data file, 2 - value file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param free_get_value value file get value without authentication (0 - disabled, 1 - enabled) + * @param record_size cyclic record file size of record + * @param max_number_of_rec cyclic record file maximal number of record + * @param curr_number_of_rec cyclic record file number of used record + * @param ex_unauth_operation TMC file exclude unauthorized operation + * @param tmc_limit_conf TMC file limit configuration + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param tmc_limit TMC file counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_get_file_settings(uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, VAR uint8_t *free_get_value, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *ex_unauth_operation, VAR uint8_t *tmc_limit_conf, VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, VAR uint32_t *tmc_limit); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered read_key_no read key number (0 - 4) write_key_no write key number (0 - 4) read_write_key_no read write key number (0 - 4) change_key_no change key number (0 - 4) + * @param key_no DESCRIPTION + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no currnent change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Function changes file settings of the Transaction MAC file. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no aes_key_no + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings(uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * @ingroup UNDOCUMENTED + * + * @param aes_key_ext aes_key_ext + * @param file_no file_no + * @param key_no key_no + * @param curr_communication_mode curr_communication_mode + * @param new_communication_mode new_communication_mode + * @param read_key_no read_key_no + * @param commit_reader_id_key_no commit_reader_id_key_no + * @param change_key_no change_key_no + * @param ex_unauth_operation ex_unauth_operation + * @param tmc_limit_conf tmc_limit_conf + * @param tmc_limit tmc_limit + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_tmc_file_settings_pk(IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t ex_unauth_operation, uint8_t tmc_limit_conf, uint32_t tmc_limit); + + /** + * @brief + * From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pk(IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file(uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in credit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of credit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_credit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in debit value operation. Function also returns decrypted Previous Reader ID. User must enter file number, value of credit, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param value value of debit + * @param trans_mac_counter transaction MAC counter uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param uid pointer to 7 bytes array containing card UID trans_mac_key pointer to 16 bytes array containing Transaction MAC key reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_debit_value_transaction_mac(uint8_t file_no, uint32_t value, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in write record operation. Function also returns decrypted Previous Reader ID. User must enter file number, data offset, data length, array of data, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param offset data offset + * @param data_len length of array of data + * @param data pointer to data array + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_check_write_record_transaction_mac(uint8_t file_no, uint32_t offset, uint32_t data_len, IN uint8_t *data, uint32_t trans_mac_counter, + IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + /** + * @brief From library version 5.0.37 and firmware version 5.0.38. For Desfire Light, and Desfire EV2. + * Helper function for check transaction MAC in clear record operation. Function also returns decrypted Previous Reader ID. Users must enter file number, transaction MAC counter, card UID, transaction MAC key, Reader ID, encrypted Previous Reader ID and transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_Light + * + * @param file_no file number + * @param trans_mac_counter transaction MAC counter + * @param uid pointer to 7 bytes array containing card UID + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param reader_id pointer to 16 bytes array containing Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing Previous Encrypted Reader ID + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * @param prev_reader_id pointer to 16 bytes array containing Previous Reader ID + * + * @return Operation status + */ + UFR_STATUS DL_API desfire_check_clear_record_transaction_mac(uint8_t file_no, uint32_t trans_mac_counter, IN uint8_t *uid, IN uint8_t *trans_mac_key, + IN uint8_t *reader_id, IN uint8_t *prev_enc_reader_id, IN uint8_t *trans_mac_value, OUT uint8_t *prev_reader_id); + + // reader + /** + * @brief Function returns various reader states. + * + * From library version 5.0.31 and firmware version 5.0.33 + * The reader states are defined into following structures. This function is useful for checking if the reader is still in emulation mode after calling the TagEmulationStartRam() function. + * typedef enum E_EMULATION_MODES { + * TAG_EMU_DISABLED, + * TAG_EMU_DEDICATED, + * TAG_EMU_COMBINED, + * TAG_EMU_AUTO_AD_HOC + * }emul_modes_t; + * typedef enum E_EMULATION_STATES + * { + * EMULATION_NONE, + * EMULATION_IDLE, + * EMULATION_AUTO_COLL, + * EMULATION_ACTIVE, + * EMULATION_HALT, + * EMULATION_POWER_OFF + * }emul_states_t; + * typedef enum E_PCD_MGR_STATES + * { + * PCD_MGR_NO_RF_GENERATED, + * PCD_MGR_14443A_POLLING, + * PCD_MGR_14443A_SELECTED, + * PCD_MGR_CE_DEDICATED, + * PCD_MGR_CE_COMBO_START, + * PCD_MGR_CE_COMBO, + * PCD_MGR_CE_COMBO_IN_FIELD + * }pcd_states_t; + * + * @ingroup Miscellaneous + * + * @param state - normal working mode states are PCD_MGR_NO_RF_GENERATED or PCD_MGR_14443A_POLLING or PCD_MGR_14443A_SELECTED. - NTAG emulation mode state is PCD_MGR_CE_DEDICATED emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_mode - normal working mode state is TAG_EMU_DISABLED - NTAG emulation mode state is TAG_EMU_DEDICATED emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param emul_state state from structure emul_states_t sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * @param sleep_mode 0 - reader is in normal or emulation mode 1 - reader is in sleep mode + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderStatus(VAR pcd_states_t *state, VAR emul_modes_t *emul_mode, VAR emul_states_t *emul_state, VAR uint8_t *sleep_mode); + + // EMV FUNCTIONS + + /** + * @brief Used for extracting the credit card PAN number. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param pan_str Pointer to char array containing credit card PAN. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetPAN(IN c_string df_name, OUT char *pan_str); + + /** + * @brief Used for extracting details about the last transaction stored in a credit card. Must provide card’s Payment System Environment (PSE1 or PSE2). + * + * @ingroup Card_Tag_CardFeatures_EMV + * + * @param df_name Name of Payment System Environment used. Use value “1PAY.SYS.DDF01” for PSE1, or “2PAY.SYS.DDF01” for PSE2 + * @param last_transaction_info Pointer to char array containing details about the last transaction stored in the card. + * + * @return Operation status + */ + UFR_STATUS DL_API EMV_GetLastTransaction(IN c_string df_name, OUT char *last_transaction_info); + + + /** + * @brief Function is used for extracting image pixel values and storing them in the display for later use. This function will not render the image to the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param gallery_index - where in displays memory to store the bitmap(0-10) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveBitmapToGallery(const char* filename, int gallery_index); + + /** + * @brief Function takes an image and extracts it's pixel values and then just renders the on the display without storing the bitmap in the display + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param timeout - how long the bitmap should stay on display, 0-is indefinitely + * @param positionX - where on the display to start the bitmap. + * @param positionY - where on the display to start the bitmap. + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmap(const char* filename, uint32_t timeout, int positionX, int positionY); + + /** + * @brief Function renders an image that is stored in the display gallery. The gallery consist of 15 slots, of those 15 - 10 are used for storing bitmaps and the other 4 (11-15) are SystemBitmaps used by the display. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param gallery_index - which slot from the gallery to render on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowBitmapFromGallery(int gallery_index); + + /** + * @brief Function allows you to change the essential symbols that the display regularly uses. These symbols include the Boot Image (ID-15), the Check bitmap(ID-14), and the Cross bitmap (ID-13). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param filename - pointer to the image + * @param system_bitmap_index - ID of which system bitmap to change or import new (if slot is free 11-12) + * @return Operation status + */ + UFR_STATUS DL_API Display_SaveSystemBitmap(const char* filename, int system_bitmap_index); + + /** + * @brief Function renders the last image that was called with the function Display_ShowBitmap() + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowLastUnsavedImage(); + + /** + * @brief Function is used for communicating with the uFR device via I2C in COM protocol format. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param cmd - Command packet (read the "COM protocol" for more information) + * @param cmd_ext - Command extended packet, if cmd_ext is not being sent then should be "NULL" + * @param rsp - Array where the response will be written (at least 7 bytes) + * @return Operation status + */ + UFR_STATUS DL_API Display_Transmit(uint8_t *cmd, uint8_t *cmd_ext, uint8_t *rsp); + + /** + * @brief Function displays custom text on the screen. It can also enable text scrolling, position the text at a specific location on the display, and adjust the font size and style + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param customText - pointer to a string text + * @param fontStyle - number to change font style (0-1; 0 - default; 1 - not implemented) + * @param fontSize - number to change font size (0-1; 0 - 8x8 pixels; 1 - 16x16 pixels) + * @param scrollEnable - number to enable scroll (0-1) + * @param positionX - number containing X cordinate to place the text + * @param positionY - number containing Y cordinate to place the text + * @return Operation status + */ + UFR_STATUS DL_API Display_PrintText(const char* customText, int fontStyle, int fontSize, int scrollEnable, int positionX, int positionY); + + /** + * @brief Function displays a chec or a cross bitmap and, if a speaker is connected to the display, it triggers a function that produces a beep sound + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param signal - number to display a check or a cross symbol on the display (1-2; 1-cross; 2-check) + * @return Operation status + */ + UFR_STATUS DL_API Display_UserInterfaceSignal(int signal); + + /** + * @brief Function writes the time on the display. If the display is not connected to the Reader, the time will be displayed and remain unchanged. However, if the display is connected to the Reader, the time will be shown only for a second because the Reader is sending the correct time to the display every second. + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param hour - number that represetns the hour that will be drawn on the display + * @param minute - number that represetns the minute that will be drawn on the display + * @return Operation status + */ + UFR_STATUS DL_API Display_ShowTime(int hour, int minute); + + /** + * @brief Function clears a specified section of the display. If xPosEND or yPosEND are set to 0, the function will automatically assume that the end postion for erasing extends to the edge of the screen (i.e., xPosEND will default to the display's maximum width, and yPosEND will default to it's maximum height). + * @since uFCoder library version 6.0.5 + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_DisplayControl + * @param xPos - number containing X coordinate to clear on the display, start position + * @param xPosEND - number containing X coordinate to clear on the display, end position + * @param yPos - number containing Y coordinate to clear on the display, start position + * @param yPosEND - number containing Y coordinate to clear on the display, end position + * @return Operation status + */ + UFR_STATUS DL_API Display_EraseSection(int xPos,int xPosEND,int yPos,int yPosEND); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceData(IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceData(OUT uint8_t *data); + + + + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + // XXX: Support for multiple readers with same DLL + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ################# M U L T I R E A D E R S U P P O R T ################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + // ############################################################################# + + //-------------------------------------------------------------------------------------------------- + + ///--------------------------------------------------------------------- + /** + * @brief This is the first function in the order for execution for the multi-reader support. + * The function prepares the list of connected uF-readers to the system and returns the number of list items - number of connected uFR devices. + * ReaderList_UpdateAndGetCount() scans all communication ports for compatible devices, probes open readers if still connected, if not close and marks their handles for deletion. If some device is disconnected from the system this function should remove its handle. + * As of uFCoder version 5.0.73, this function probes both FTDI & COM devices and tries to open them. + * Each call to this method will close previously opened devices by this function, scan, and open everything found. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param NumberOfDevices how many compatible devices are connected to the system + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_UpdateAndGetCount(VAR int32_t *NumberOfDevices); + + /** + * @brief Used to retrieve information about a reader found & connected via ReaderList_UpdateAndGetCount(). + * This should be executed for each device based on number of devices found, providing valid index. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex index of the device in the readers list + * @param DeviceHandle assigned Handle + * @param DeviceSerialNumber device serial number + * @param DeviceType device type - device identification in AIS database + * @param DeviceFWver version of firmware + * @param DeviceCommID device identification number (master) + * @param DeviceCommSpeed communication speed + * @param DeviceCommFTDISerial FTDI COM port identification + * @param DeviceCommFTDIDescription FTDI COM port description + * @param DeviceIsOpened is Device opened + * @param DeviceStatus actual device status + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetInformation( // + uint32_t DeviceIndex, // index of the device to get information from + VAR UFR_HANDLE *DeviceHandle, //// assigned Handle + OUT c_string *DeviceSerialNumber, //// device serial number + VAR int *DeviceType, //// device type - device identification in AIS database + OUT c_string *DeviceFWver, //// version of firmware + VAR int *DeviceCommID, //// device identification number (master) + VAR int *DeviceCommSpeed, //// communication speed + OUT c_string *DeviceCommFTDISerial, //// FTDI COM port identification + OUT c_string *DeviceCommFTDIDescription, //// FTDI COM port description + VAR int *DeviceIsOpened, //// is Device opened + VAR int *DeviceStatus //// actual device status + ); + + /** + * @brief Force handle deletion when you identify that the reader is no longer connected, and want to release the handle immediately. If the handle exists in the list of opened devices, function would try to close communication port and destroy the handle. + * When uFR reader is disconnected, ReaderList_UpdateAndGetCount() will do that (destroy) automatically in next execution. + * + * @param DeviceHandle The handle that will be destroyed + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Destroy(UFR_HANDLE *DeviceHandle); + + /** + * @brief This method is used for manual addition of uFR devices to the list. Parameters used are the same as in ReaderOpenEx() method. Use this method if the device was not previously discovered by the ReaderList_UpdateAndGetCount() method. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceHandle the handle that will be assigned for interacting with the specified reader on success. + * @param reader_type Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_name Refer to ReaderOpenEx() for detailed description of this parameter. + * @param port_interface Refer to ReaderOpenEx() for detailed description of this parameter. arg Refer to ReaderOpenEx() for detailed description of this parameter. + * @param arg Refer to ReaderOpenEx() for detailed description of this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_Add(UFR_HANDLE *DeviceHandle, uint32_t reader_type, + c_string port_name, uint32_t port_interface, void *arg); + + /** + * @brief Tries to re-open the device based on the serial number of the device. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param hndUFR handle of the uFR device + * @param Device_SN Serial number of the device contained as char array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenBySerial(VAR UFR_HANDLE *hndUFR, const char Device_SN[16]); + + // XXX: Obsolete functions - remain for backward compatibility + /** + * @brief + * Gets reader’s reader serial number as a pointer to 4 byte value, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulSerialNumber Contains reader serial number as a 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialByIndex(int32_t DeviceIndex, VAR uint32_t *lpulSerialNumber); + + /** + * @brief Gets reader’s descriptive name as a array of 8 chars, based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param pSerialDescription Contains reader serial number as array of 8 chars + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetSerialDescriptionByIndex(int32_t DeviceIndex, OUT uint8_t pSerialDescription[8]); + + /** + * @brief Gets devices reader type based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param lpulReaderType Contains reader type as 4 byte value (uint32_t) + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetTypeByIndex(int32_t DeviceIndex, VAR uint32_t *lpulReaderType); + + /** + * @brief Gets devices FTDI serial port number based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Serial Contains FTDI serial number as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDISerialByIndex(int32_t DeviceIndex, OUT char **Device_Serial); + + /** + * @brief Gets devices FTDI description based on the index of the device in the list. + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param Device_Description FTDI description as c_string + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_GetFTDIDescriptionByIndex(int32_t DeviceIndex, OUT char **Device_Description); + + /** + * @brief Tries to re-open the device based on the device index. This method should be called when you use ReaderCloseM() to close the communication with the reader opened by ReaderList_UpdateAndGetCount(). + * + * @ingroup ReaderAndLibrary_ReaderList + * + * @param DeviceIndex Index of the device + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderList_OpenByIndex(const int32_t DeviceIndex, VAR UFR_HANDLE *hndUFR); + + //-------------------------------------------------------------------------------------------------- + + // open first/next Reader and return handle - better to use ReaderList_OpenByIndex() + /** + * @brief Multi reader support. Open reader communication port for all µFR devices. You can also use this function to open communication with µFR Online devices. + * Using ReaderOpen to open communication with µFR Online devices: + * If you have only one reader attached to your PC, it will open that reader serial port on 1Mbit/s, or if you have only one reader attached to another power supply (not your PC) it will open that reader based on it’s working mode (TCP or UDP). If you have more than one µFR Online device, ReaderOpen function will open the first one found, for opening another device, use ReaderOpenEx instead. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderOpenM(VAR UFR_HANDLE *hndUFR); + +#ifdef ESP_PLATFORM + /** + * @brief @param hndUFR handle of the uFR device + * @param port_num + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderOpenM(VAR UFR_HANDLE *hndUFR, uint32_t port_num); +#endif + + /** + * @brief Multi reader support. Physical reset of reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Close reader communication port. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderCloseM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function is used to restart the reader by software. It sets all readers parameters to default values and close RF field which resets all the cards in the field. + * + * @ingroup ReaderAndLibrary_Communication_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoftRestartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Returns reader type as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulReaderType pointer to lpulReaderType variable. “lpulReaderType” as result - please refer to Appendix: DLogic reader type enumeration. E.g. for µFR Nano Classic readers this value is 0xD1180022. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTypeM(UFR_HANDLE hndUFR, OUT uint32_t *lpulReaderType); + + /** + * @brief Multi reader support. Returns reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialNumberM(UFR_HANDLE hndUFR, OUT uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Retrieve info if reader is still connected to host. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param connected pointer to connected variable “connected” as result: > 0 Reader is connected on system = 0 Reader is not connected on system anymore (or closed) < 0 other error “connected” - Pointer to unsigned int type variable 32 bit long, where the information about readers availability is written. If the reader is connected on system, function store 1 (true) otherwise, on some error, store zero in that variable. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderStillConnectedM(UFR_HANDLE hndUFR, VAR uint32_t *connected); + + /** + * @brief Multi reader support. Store a new key or change existing key under provided index parameter.The keys are in a special area in EEPROM that can not be read anymore which gains protection. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucKey Pointer to an array of 6 bytes containing the key. Default key values are always “FF FF FF FF FF FF” hex. + * @param ucKeyIndex key Index. Possible values ​​are 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeyWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucKey, uint8_t ucKeyIndex); + + /** + * @brief Multi reader support. Lock reader’s keys to prevent further changing. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysLockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. Unlock reader’s keys if they are locked with previous function. + * The factory setting is that reader keys are unlocked. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing valid password. + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderKeysUnlockM(UFR_HANDLE hndUFR, IN const uint8_t *password); + + /** + * @brief Multi reader support. This function turns sound and light reader signals. Sound signals are performed by the reader's buzzer and light signals are performed by the reader's LEDs. + * There are predefined signal values for sound and light: + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_signal_mode 0 - None, 1 - Long Green, 2 - Long Red, 3 - Alternation, 4 - Flash + * @param beep_signal_mode 0 - None, 1 - Short, 2 - Long, 3 - Double Short, 4 - Triple Short, 5 - Triplet Melody + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderUISignalM(UFR_HANDLE hndUFR, uint8_t light_signal_mode, uint8_t beep_signal_mode); + + /** + * @brief Multi reader support. From version 5.0.68. + * Function sets the duty cycle ratio of the sound signal. Value is in percent (0 - 100%). Default value is 50%, and this value will be set after the reset of the reader, without using this function. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param sound_volume volume in percent 0 - 100 % + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderSoundVolumeM(UFR_HANDLE hndUFR, uint8_t sound_volume); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Read user data written in device NV memory. + * User data is 16 byte long. + * From version 5.0.86. function ReadUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 bytes array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API ReadUserDataExtM(UFR_HANDLE hndUFR, OUT uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Write user data into the device's NV memory. User data is 16 byte long. + * From version 5.0.86. function WriteUserDataExt added. When using this function, user data is 32 bytes long. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param aucData pointer to a 16 byte array containing user data, or 32 bytes for ReadUserDataExt + * + * @return Operation status + */ + UFR_STATUS DL_API WriteUserDataExtM(UFR_HANDLE hndUFR, IN const uint8_t *aucData); + + /** + * @brief Multi reader support. Returns card UID as a 4-byte array. This function is deprecated and used only for backward compatibility with older firmware versions (before v2.0). We strongly discourage use of this function. This function can’t successfully handle 7 byte UIDS. + * + * @param hndUFR handle of the uFR device + * @param lpucCardType returns pointer to variable which holds card type according to SAK lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * @param lpulCardSerial returns pointer to array of card UID bytes, 4 bytes long ONLY + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType, OUT uint32_t *lpulCardSerial); + + /** + * @brief Function returns ATQA and SAK (ISO 14443-3) of selected card. + * + * Multi reader support. From library version 5.0.36 and firmware version 5.0.37 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param atqa pointer to variable which contain ATQA sak pointer to variable which contain SAK + * @param sak pointer to variable which contain SAK + * + * @return Operation status + */ + UFR_STATUS DL_API GetAtqaSakM(UFR_HANDLE hndUFR, uint16_t *atqa, uint8_t *sak); + + /** + * @brief Multi reader support. Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.28) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authenticationwith key A or key B:use KeyA - MIFARE_AUTHENT1A = 0x60or KeyB - MIFARE_AUTHENT1B = 0x61For NTAG 21x, Ultralight EV1 and other T2T tags supportingPWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead()or LinearRead_PK() functions. Value 0x60 with LinearRead() orLinearRead_PK() functions means “without PWD_AUTH“ and in thatcase you can send for ucReaderKeyIndex or aucProvidedKeyparameters anything you want without influence on the result. ForNTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTHyou can use _AKM1 or _AKM2 function variants only withoutPWD_AUTH in any case of the valid values (0x60 or 0x61) providedfor this parameter.For Mifare Plus tags (PK mode) defines whether to performauthentication with key A or key B:use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearReadSamKeyM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start reading + * @param usDataLength Length of data - how many bytes to read + * @param lpusBytesReturned Pointer to variable holding how many bytes are returned + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowReadM(UFR_HANDLE hndUFR, OUT uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesReturned, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param aucData Pointer to array of bytes containing data + * @param usLinearAddress Address of byte - where to start writting + * @param usDataLength Length of data - how many bytes to write + * @param lpusBytesWritten Pointer to variable holding how many bytes were written + * @param ucKeyMode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param ucReaderKeyIndex Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearWriteSamKeyM(UFR_HANDLE hndUFR, IN const uint8_t *aucData, uint16_t usLinearAddress, uint16_t usDataLength, + VAR uint16_t *lpusBytesWritten, uint8_t ucKeyMode, uint8_t ucReaderKeyIndex); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCardM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteSamKeyM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key_index Index of reader’s key to be used (RK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafeM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *sector_trailer, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorReadSamKeyM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWriteSamKeyM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrementSamKeyM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + uint8_t key_index); + + /** + * @brief Multi reader support. Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key_index Index of reader’s key to be used (RK mode)For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrementSamKeyM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, uint8_t key_index); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM1M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters + + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM1M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM1M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM1M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM1M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM1M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented sector_address Absolute Sector address block_in_sector_address Block address in Sector auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 1 (AKM1) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM1M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) For keys into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.29 and library versions from 5.0.19. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read bytes_returned + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_AKM2M(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write bytes_returned + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_AKM2M(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_AKM2M(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_AKM2M(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) ValueBlockDecrement Function description Decrements particular Value block with specified value using absolute Block address. Mifare Plus X, SE and EV1 using. For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. Function declaration (C language) UFR_STATUS ValueBlockDecrement(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); UFR_STATUS ValueBlockDecrement_AKM1(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode; UFR_STATUS ValueBlockDecrement_AKM2(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); UFR_STATUS ValueBlockDecrement_PK(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, const uint8_t *key); *only uFR CS with SAM support UFR_STATUS ValueBlockDecrementSamKey(int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, uint8_t key_index); + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_AKM2M(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_AKM2M(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Automatic Key Mode 2 (AKM2) + * Decrements particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_AKM2M(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using absolute Block address. + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockRead() or BlockRead_PK() functions. Value 0x60 with BlockRead() or BlockRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API BlockRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using absolute Block address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param block_address Absolute block address + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockWrite() or BlockWrite_PK() functions. Value 0x60 with BlockWrite() or BlockWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t block_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorRead() or BlockInSectorRead_PK() functions. Value 0x60 with BlockInSectorRead() or BlockInSectorRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular block using relative Block in Sector address. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with BlockInSectorWrite() or BlockInSectorWrite_PK() functions. Value 0x60 with BlockInSectorWrite() or BlockInSectorWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API BlockInSectorWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint8_t sector_address, uint8_t block_in_sector_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearRead() or LinearRead_PK() functions. Value 0x60 with LinearRead() or LinearRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read Linear data Address Space. On the contrary of LinearRead functions, this functions read whole card including trailer blocks and manufacturer block. + * This function is useful when making “dump” of the whole card. + * Linear reading in uFR firmware utilise FAST_READ ISO 14443-3 command with NTAG21x and Mifare Ultralight EV1 tags. When using this functions with other card types, auth_mode, key_index and key parameters are not relevant but must take default values. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start reading + * @param length Length of data - how many bytes to read + * @param bytes_returned Pointer to variable holding how many bytes are returned + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinRowRead() or LinRowRead_PK() functions. Value 0x60 with LinRowRead() or LinRowRead_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinRowRead_PKM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_returned, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * These functions are used for writing data to the card using emulation of the linear address space. The method for proving authenticity is determined by the suffix in the functions names. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param data Pointer to array of bytes containing data + * @param linear_address Address of byte - where to start writing + * @param length Length of data - how many bytes to write + * @param bytes_written Pointer to variable holding how many bytes were written + * @param auth_mode For Mifare Classic tags defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH value 0x61 means “use PWD_AUTH“ with LinearWrite() or LinearWrite_PK() functions. Value 0x60 with LinearWrite() or LinearWrite_PK() functions means “without PWD_AUTH“ and in that case you can send for ucReaderKeyIndex or aucProvidedKey parameters anything you want without influence on the result. For NTAG 21x, Ultralight EV1 and other T2T tags supporting PWD_AUTH you can use _AKM1 or _AKM2 function variants only without PWD_AUTH in any case of the valid values (0x60 or 0x61) provided for this parameter. For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 bytes array containing Crypto1 key (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearWrite_PKM(UFR_HANDLE hndUFR, IN const uint8_t *data, uint16_t linear_address, uint16_t length, + VAR uint16_t *bytes_written, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It performs “Format card” operation - write new Sector Trailer values on whole card at once. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Bytes 0 - 5 + * Bytes 6 - 8 + * Byte 9 + * Bytes 10 - 15 + * KeyA + * Block Access & + * Trailer Access Bits + * GPB + * KeyB + * For more information, please refer to Mifare Classic Keys and Access Conditions in this document. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authetntication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are caluculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provode to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param blocks_access_bits Block Access permissions bits. Values 0 to 7 + * @param sector_trailers_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailers_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyA + * @param lpucSectorsFormatted Pointer to variable holding return value how many sectors are successfully formatted + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API LinearFormatCard_PKM(UFR_HANDLE hndUFR, IN const uint8_t *new_key_A, uint8_t blocks_access_bits, + uint8_t sector_trailers_access_bits, uint8_t sector_trailers_byte9, IN const uint8_t *new_key_B, + VAR uint8_t *lpucSectorsFormatted, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Mifare Plus using. + * For firmware versions from 5.0.29 and library versions from 5.0.19, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculated from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param new_key_A Pointer on 6 bytes array containing a new KeyA + * @param block0_access_bits Access Permissions Bits for Block 0. Values 0 to 7 + * @param block1_access_bits Access Permissions Bits for Block 1. Values 0 to 7 + * @param block2_access_bits Access Permissions Bits for Block 2. Values 0 to 7 + * @param sector_trailer_access_bits Sector Trailer Access permissions bits. Values 0 to 7 + * @param sector_trailer_byte9 GPB value + * @param new_key_B Pointer on 6 bytes array containing a new KeyB + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWrite_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, IN const uint8_t *new_key_A, + uint8_t block0_access_bits, uint8_t block1_access_bits, uint8_t block2_access_bits, + uint8_t sector_trailer_access_bits, uint8_t sector_trailer_byte9, IN const uint8_t *new_key_B, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is specific to Mifare Classic cards only. It writes new Sector Trailer value at one Sector Trailer. It writes following data: + * KeyA, Block Access Bits, Trailer Access Bits, GeneralPurposeByte(GPB), KeyB, same as construction of Sector Trailer. + * Difference between this function and SectorTrailerWrite is : + * * SectorTrailerWrite will check parameters and “safely” write them into trailer, non valid values will not be written + * * SectorTrailerWriteUnsafe writes array of 16 bytes as raw binary trailer representation, any value can be written. + * USE THIS FUNCTION WITH CAUTION, WRONG VALUES CAN DESTROY CARD! + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param addressing_mode Defines if Absolute (0) or Relative (1) Block Addressing mode is used + * @param address Address of Trailer according to addressing_mode + * @param sector_trailer Pointer to 16 byte array as binary representation of Sector Trailer + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 + * @param key Pointer to 6 byte array containing key bytes (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API SectorTrailerWriteUnsafe_PKM(UFR_HANDLE hndUFR, uint8_t addressing_mode, uint8_t address, + IN const uint8_t *sector_trailer, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t block_address, + uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Read particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of reading value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorRead_PKM(UFR_HANDLE hndUFR, VAR int32_t *value, VAR uint8_t *value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Write particular Value block using absolute Block address. This function uses Mifare Classic specific mechanism of writing value which is stored into whole block. Value blocks have a fixed data format which permits error detection and correction and a backup management. Value is a signed 4-byte value and it is stored three times, twice non-inverted and once inverted. Negative numbers are stored in standard 2's complement format. For more info, please refer to Mifare Classic documentation. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to variable where retrieved value will be stored + * @param value_addr Signifies a 1-byte address, which can be used to save the storage address of a block, when implementing a powerful backup management. For more info, please refer to Mifare Classic documentation. + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorWrite_PKM(UFR_HANDLE hndUFR, int32_t value, uint8_t value_addr, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value value showing how much initial block value will be incremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Increments particular Value block with specified value using Block in Sector address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param increment_value increment value to add + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorIncrement_PKM(UFR_HANDLE hndUFR, int32_t increment_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Decrements particular Value block with specified value using absolute Block address. + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param block_address Absolute block address + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 key_index Index of reader’s key to be used (RK mode) For Crypto1 keys (0 - 31) For Mifare Plus AES keys (0 - 15) (fw version to 5.0.36) For key into SAM (1 - 127) For Mifare Plus and fw versions from 5.0.36 and library versions from 5.0.34. in MIFARE_AUTHENT1A or MIFARE_AUTHENT1B mode uses AES key calculated from Crypto1 key (0 -31), and in MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B mode uses AES keys (0 - 15) + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t block_address, uint8_t auth_mode, + IN const uint8_t *key); + + /** + * @brief Provided Key mode (PK) Decrements particular Value block with specified value using Block in Sector address. + * + * Mifare Plus X, SE and EV1 using. + * For firmware versions from 5.0.36 and library versions from 5.0.34, this functions may be used for Mifare plus cards. If authentication mode is MIFARE_AUTHENT1A or MIFARE_AUTHENT1B, AES key for authentication, and new AES key A and new AES key B are calculate from Crypto1 keys. If authentication mode is MIFARE_PLUS_AES_AUTHENT1A or MIFARE_PLUS_AES_AUTHENT1B, new AES keys are provided to reader. + * Multi reader support. + * @ingroup Card_Tag_Mifare_M + * + * @param hndUFR handle of the uFR device + * @param decrement_value value showing how much initial block value will be decremented + * @param sector_address Absolute Sector address + * @param block_in_sector_address Block address in Sector + * @param auth_mode Defines whether to perform authentication with key A or key B: use KeyA - MIFARE_AUTHENT1A = 0x60 or KeyB - MIFARE_AUTHENT1B = 0x61 For Mifare Plus tags (PK mode) defines whether to perform authentication with key A or key B: use KeyA - MIFARE_PLUS_AES_AUTHENT1A = 0x80 or KeyB - MIFARE_PLUS_AES_AUTHENT1B = 0x81 + * @param key Pointer to 6 byte array containing key bytes (PK mode) For Mifare Plus pointer to 16 bytes array containing AES key (PK mode) + * @return Operation status + */ + UFR_STATUS DL_API ValueBlockInSectorDecrement_PKM(UFR_HANDLE hndUFR, int32_t decrement_value, uint8_t sector_address, + uint8_t block_in_sector_address, uint8_t auth_mode, IN const uint8_t *key); + + /** + * @brief Multi reader support. Returns reader hardware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderHardwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + /** + * @brief Multi reader support. Returns reader firmware version as two byte representation of higher and lower byte. + * + * @ingroup ReaderAndLibrary_Information_M + + * @param hndUFR handle of the uFR device + * @param version_major pointer to version major variable + * @param version_minor pointer to version minor variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderFirmwareVersionM(UFR_HANDLE hndUFR, VAR uint8_t *version_major, VAR uint8_t *version_minor); + + // New commands (for RTC & I2C EEPROM): + /** + * @brief Multi reader support. Function returns a 6 bytes array of uint8_t that represents the current date and time into the device's RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderTimeM(UFR_HANDLE hndUFR, VAR uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into the device's RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in the GetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RTC_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password time + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API SetReaderTimeM(UFR_HANDLE hndUFR, IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Multi reader support. This function is used in Common, Advance and Access Control set of functions. + * It defines/changes password which I used for: + * * Locking/unlocking keys stored into reader + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API ChangeReaderPasswordM(UFR_HANDLE hndUFR, IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM. Maximal length of array is 128 bytes. Function requires password which length is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromWriteM(UFR_HANDLE hndUFR, IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM. Maximal length of array is 128 bytes. + * + * @ingroup ReaderAndLibrary_EEPROM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderEepromReadM(UFR_HANDLE hndUFR, OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Returns reader’s descriptive name as a row of 8 chars. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param pSerialDescription pointer to pSerialDescription array + * + * @return Operation status + */ + UFR_STATUS DL_API GetReaderSerialDescriptionM(UFR_HANDLE hndUFR, OUT uint8_t pSerialDescription[8]); + + // New since version 2.0: + /** + * @brief Multi reader support. Returns reader firmware build version as one byte representation. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * @param build pointer to build variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetBuildNumberM(UFR_HANDLE hndUFR, VAR uint8_t *build); + + /** + * @brief Multi reader support. This function returns UID of card actually present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. + * This function is recommended for use instead of GetCardId. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + /** + * @brief Multi reader support. This function returns UID of last card which was present in RF field of reader. + * + * It can handle all three known types : 4, 7 and 10 byte long UIDs. Difference with GetCardIdEx is that card does not be in RF field mandatory, UID value is stored in temporary memory area. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucSak returns pointer to variable which holds card type according to SAK + * @param aucUid returns pointer to array of card UID bytes, variable length + * @param lpucUidSize returns pointer to variable holding information about UID length + * + * @return Operation status + */ + UFR_STATUS DL_API GetLastCardIdExM(UFR_HANDLE hndUFR, VAR uint8_t *lpucSak, OUT uint8_t *aucUid, VAR uint8_t *lpucUidSize); + + //------------------------------------------------------------------------------ + // Multi card mode: + //------------------------------------------------------------------------------ + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Exits from “anti-collision” mode of operation i.e. put the reader in to “single card” mode of operation. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DisableAntiCollisionM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. If the reader is in an “anti-collision” mode of operation, this function enumerates cards which are found in the reader field. Otherwise the function returns ANTI_COLLISION_DISABLED status code. + * All the calls to the ListCards(), SelectCard() and DeselectCard() work with UIDs from the actual UID list of the enumerated cards, which is obtained by the last call of this function. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardsNumber If the function is successfully executed, the memory location on which this pointer points to, will contain a number of the enumerated cards. + * @param lpucUidListSize If the function is successfully executed, the memory location on which this pointer points to, will contain a UID list of the enumerated cards size in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API EnumCardsM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardsNumber, OUT uint8_t *lpucUidListSize); // Card pointer is on the first card in list + + /** + * @brief Multi reader support. Before calling this function you have to call EnumCards() first. + * For each UID of the cards detected in the reader field, there are 11 “UID record bytes” allocated in the list. First of those 11 bytes allocated designate actual UID length immediately followed by the exactly 10 bytes of UID (which is maximum hypothetical UID size). E.g, if the actual UID length is 4 bytes, you should ignore last 6 bytes of the UID record. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUidList Pointer to the memory alocated for the UID list. Before calling this function, you should alocate atleast *lpucUidListSize bytes which is returned by the prior call to EnumCards() function. + * @param ucUidListSize Size (in bytes) of the array alocated on the memory location aucUidList points to. + * + * @return Operation status + */ + UFR_STATUS DL_API ListCardsM(UFR_HANDLE hndUFR, OUT uint8_t *aucUidList, uint8_t ucUidListSize); // Before calling this function you must call EnumCards() first. + + /** + * @brief Multi reader support. Selects one of the cards which UID is on the actual UID list of the enumerated cards. If there is any of the cards previously selected calling this function you will get an CARD_ALREADY_SELECTED status code and, in such a case, you should call DeslectCard() function prior using SelectCard(). If UID list of the enumerated cards is empty, you will get an NO_TAGS_ENUMERRATED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param aucUid pointer to the byte array containing UID of the card which is to be selected + * @param ucUidSize actual UID size + * @param lpucSelctedCardType pointer to byte which will contain DlogicCardType constant of the selected card, in case of successful execution of this function + * + * @return Operation status + */ + UFR_STATUS DL_API SelectCardM(UFR_HANDLE hndUFR, IN const uint8_t *aucUid, uint8_t ucUidSize, OUT uint8_t *lpucSelctedCardType); + + /** + * @brief Multi reader support. If the reader is in a “anti-collision” mode of operation, this function deselects currently selected card. Otherwise function returns ANTI_COLLISION_DISABLED status code. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API DeslectCardM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Calling this function you can get current anti-collision status of the reader. + * + * @ingroup Card_Tag_CardFeatures_AntiCollision_M + * + * @param hndUFR handle of the uFR device + * @param lpcIsAntiCollEnabled pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation, 0 otherwise + * @param lpcIsAnyCardSelected pointer to byte which will contain 1 if reader is in a “anti-collision” mode of operation and there is selected card, 0 otherwise + * + * @return Operation status + */ + UFR_STATUS DL_API GetAntiCollisionStatusM(UFR_HANDLE hndUFR, VAR int8_t *lpcIsAntiCollEnabled, VAR int8_t *lpcIsAnyCardSelected); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns card type according to DlogicCardType enumeration. For details, please refer to Appendix: DLogic CardType enumeration. + * If the card type is not supported, function return the lpucCardType value equal to zero : TAG_UNKNOWN = 0x00 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpucCardType pointer to lpucCardType variable. Variable lpucCardType holds returned value of actual card type present in RF field. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDlogicCardTypeM(UFR_HANDLE hndUFR, VAR uint8_t *lpucCardType); + + /** + * @brief Multi reader support. + * This function returns card manufacturer as char* buffer (c-style string). + * + * For details, please refer to the ISO/IEC JTC1/SC17 STANDING DOCUMENT 5 + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param card_manufacturer_str manufacturer name as c_string. + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardManufacturerM(UFR_HANDLE hndUFR, OUT char* card_manufacturer_str); + + + /** + * @brief Multi reader support. This function returns 8 bytes of the T2T version. All modern T2T chips support this functionality and have in common a total of 8 byte long version response. This function is primarily intended to use with NFC_T2T_GENERIC tags (i.e. tags which return 0x0C in the *lpucCardType parameter of the GetDlogicCardType()). + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param lpucVersionResponse array containing 8 bytes which will receive raw T2T version. + * + * @return Operation status + */ + UFR_STATUS DL_API GetNfcT2TVersionM(UFR_HANDLE hndUFR, OUT uint8_t lpucVersionResponse[8]); + + /** + * @brief Multi reader support. Function returns size of user data space on the card (LinearSize), and size of total data space on the card (RawSize). The user data space is accessed via functions LinearWrite and LinearRead. Total data space is accessed via functions LinRowWrite and LinRowRead. For example Mifare Classic 1K card have 752 bytes of user data space (sector trailers and block 0 are not included), and 1024 bytes of total data space. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param lpulLinearSize pointer to variable which contain size of user data space + * @param lpulRawSize pointer to variable which contain size of total data space + * + * @return Operation status + */ + UFR_STATUS DL_API GetCardSizeM(UFR_HANDLE hndUFR, VAR uint32_t *lpulLinearSize, VAR uint32_t *lpulRawSize); + + /** + * @brief Function provides the information about the tag tamper status which is detected when the NTAG 213 TT is powered by an RF field. + * + * Multi reader support. From library version 5.0.59 and firmware version 5.0.60 + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * @param tt_message 4 byte Tag Tamper message. “0000” is returned, if the NTAG 213 TT has never detected the Tag Tamper as opened during the startup. If the NTAG 213 TT has once detected the tag tamper wire as opened, it returns the data which have been programmed in page 45 (TT_MESSAGE) + * @param tt_status status of the tag tamper wire detected during startup. “C” if Tag Tamper was closed at current startup “O” if Tag Tamper was open at current startup “I” if Tag Tamper measurement was incorrect + * + * @return Operation status + */ + UFR_STATUS DL_API ReadTTStatusM(UFR_HANDLE hndUFR, OUT uint8_t *tt_message, VAR uint8_t *tt_status); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. Function returns “mobile additional” data if the tag in the reader field is actually the selected HCE application in a mobile phone with the appropriate AID which can be set using the SetMobileUniqueIdAid() API. The indication that the HCE application in the mobile phone with the corresponding AID is actually selected is the card type code 0x60 (DL_MOBILE_AID) obtained by the previous call to the GetDlogicCardType() or GetCardIdEx() API. + * + * @param hndUFR handle of the uFR device + * @param data Array of bytes that should have at least 32 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function and after the successful execution contains size of the data returned by the reader (max. 32 bytes) + * + * @ingroup Card_Tag_M + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileAdditionalDataM(UFR_HANDLE hndUFR, uint8_t data[32], uint32_t *len); + + /** + * @brief Multi reader support. Function returns reader’s serialized discovery loop structure i.e. C union (following gcc example): + * typedef union { + * __attribute ((packed)) struct { + * uint16_t flags; + * uint32_t RFU; + * }; + * __attribute ((packed)) struct { + * uint8_t byte0; + * uint8_t byte1; + * uint32_t RFU; + * } bytes; + * __attribute ((packed)) struct { + * uint8_t legacy:1; + * uint8_t enable_type_a:1; + * uint8_t enable_type_b:1; + * uint8_t enable_apple_ecp:1; + * uint8_t enable_hce:1; + * uint8_t auto_select_dlogic_aid:1; + * uint8_t auto_select_apple_vas:1; + * uint8_t auto_select_google_vas:1; + * uint8_t RFU_flags; + * uint32_t RFU; + * } bits; + * } discovery_loop_setup_t; + * sizeof (discovery_loop_setup_t) is 6 bytes. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the array of bytes that should have at least sizeof (discovery_loop_setup_t) i.e. 6 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least sizeof (discovery_loop_setup_t) i.e. 6 bytes) and after the successful execution contains size of the data returned by the reader. + * + * @return Operation status + */ + UFR_STATUS DL_API GetDiscoveryLoopSetupM(UFR_HANDLE hndUFR, uint8_t *setupStruct, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s discovery loop. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param setupStruct Pointer to the serialized discovery loop structure. + * @param len Size of the serialized discovery loop structure. e.g. sizeof (discovery_loop_setup_t) i.e. 6 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SetDiscoveryLoopM(UFR_HANDLE hndUFR, const uint8_t *setupStruct, uint32_t len); + + /** + * @brief Multi reader support. Function returns the AID set in the reader to retrieve the mobile phone's unique ID. If the reader’s AID has never been set using SetMobileUniqueIdAid(), the function returns UFR_READING_ERROR status and the reader uses the default AID which is + * {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes that should have at least 16 bytes previously allocated. + * @param len Pointer to the variable containing actual size of the data array before calling this function (at least 16) and after the successful execution contains size of the data returned by the reader (max. 16 bytes) + * + * @return Operation status + */ + UFR_STATUS DL_API GetMobileUniqueIdAidM(UFR_HANDLE hndUFR, uint8_t *aid, uint32_t *len); + + /** + * @brief Multi reader support. Function sets the reader’s AID to retrieve the mobile phone's unique ID. + * + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * The default (factory) uFR AID is {0xF0, 0x01, 0x02, 0x03, 0x04, 0x05}. + * Minimum AID length is 5 bytes. Maximum AID len is 16 bytes. + * For details, see the example project at the + * https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-aid_for_mobile_unique_id_setup. + * + * @ingroup ReaderAndLibrary_uFRZeroSpecificFeatures_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to the array of bytes containing the new AID. + * @param len Size of the new AID in bytes. + * + * @return Operation status + */ + UFR_STATUS DL_API SetMobileUniqueIdAidM(UFR_HANDLE hndUFR, const uint8_t *aid, uint32_t len); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockConfigM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockDataAndOtpM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ATECC608LockKeySlotM(UFR_HANDLE hndUFR, uint8_t key_slot); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultSlotsConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608DefaultKeysConfigurationM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608IOSecretKeyM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyUnencryptedM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetATECC608ECCPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_slot, uint8_t bool_enabled, + uint8_t pub_key_id[4], uint8_t merchant_id[32], uint8_t ecc_priv_key[32]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ConfigZoneM(UFR_HANDLE hndUFR, uint8_t config_zone[128]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608OtpZoneM(UFR_HANDLE hndUFR, uint8_t otp_zone[64]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608ZonesLockStatusM(UFR_HANDLE hndUFR, VAR uint8_t *bool_config_zone_locked, + VAR uint8_t *bool_otp_zone_locked); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetATECC608InfoRevisionM(UFR_HANDLE hndUFR, uint8_t revision[4]); + + //------------------------------------------------------------------------------ + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderProModeM(UFR_HANDLE hndUFR, VAR uint32_t *pReaderProMode, OUT uint32_t *pReaderProConfig); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API SetReaderProModeM(UFR_HANDLE hndUFR, const uint32_t ReaderProMode); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_InitializeM(UFR_HANDLE hndUFR, IN const uint8_t *TBSerialString, uint16_t job_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextEncryptedCardM(UFR_HANDLE hndUFR, const uint32_t from_timestamp, const uint32_t to_timestamp, + OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetNextM(UFR_HANDLE hndUFR, const uint32_t code_type, const uint32_t from_timestamp, + const uint32_t to_timestamp, const uint32_t additional_data_size, + IN const uint8_t additional_data[], VAR uint32_t *out_card_data_size, OUT uint8_t out_card_data[]); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetActualCardSNM(UFR_HANDLE hndUFR, OUT uint32_t *ActualCard_SN, VAR uint32_t *ActualCard_SN_LOG); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetJobSNM(UFR_HANDLE hndUFR, VAR uint32_t *JobSN); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API CardEncryption_GetSalterSNM(UFR_HANDLE hndUFR, OUT uint8_t SalterSN[8], VAR uint8_t *magicByte); + + /** + * @brief Multi reader support. Function returns TNF, type of record, ID and payload from the NDEF record. NDEF record shall be elected by the message ordinal and record ordinal in this message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param record_nr NDEF record ordinal (in message) + * @param tnf pointer to the variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * + * @return Operation status + */ + UFR_STATUS DL_API read_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t record_nr, VAR uint8_t *tnf, OUT uint8_t *type_record, + VAR uint8_t *type_length, OUT uint8_t *id, VAR uint8_t *id_length, OUT uint8_t *payload, + VAR uint32_t *payload_length); + + /** + * @brief Multi reader support. Function adds a record to the end of message, if one or more records already exist in this message. If current message is empty, then this empty record will be replaced with the record. Parameters of function are: ordinal of message, TNF, type of record, ID, payload. Function also returns pointer to the variable which reported that the card formatted for NDEF using (card does not have a capability container, for example new Mifare Ultralight, or Mifare Classic card). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, uint8_t *type_length, + IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, uint32_t *payload_length, + VAR uint8_t *card_formated); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroringM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. This function works the same as the write_ndef_record(), with the additional “UID and / or NFC counter mirror” features support. NTAG 21x family of devices offers these specific features. For details about “ASCII mirror” features refer to http://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf (in Rev. 3.2 from 2. June 2015, page 20) and http://www.nxp.com/docs/en/data-sheet/NTAG210_212.pdf (in Rev. 3.0 from 14. March 2013, page 16). + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts from 1) + * @param tnf pointer to variable containing TNF of record + * @param type_record pointer to array containing type of record + * @param type_length pointer to the variable containing length of type of record string + * @param id pointer to array containing ID of record + * @param id_length pointer to the variable containing length of ID of record string + * @param payload pointer to array containing payload of record + * @param payload_length pointer to the variable containing length of payload + * @param card_formated pointer to the variable which shows that the card formatted for NDEF using. + * @param use_uid_ascii_mirror if use_uid_ascii_mirror == 1 then “UID ASCII Mirror” feature is in use. if use_uid_ascii_mirror == 0 then “UID ASCII Mirror” feature is switched off. + * @param use_counter_ascii_mirror if use_counter_ascii_mirror == 1 then “NFC counter ASCII Mirror” feature is in use. if use_counter_ascii_mirror == 0 then “NFC counter ASCII Mirror” feature is switched off. payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * @param use_tt_message_mirror if use_tt_message_mirror == 1 then Tag tamper status mirroring is enabled + * @param payload_mirroring_pos Defines the starting position of the “ASCII Mirror” into the NDEF record payload. + * + * @return Operation status + */ + UFR_STATUS DL_API write_ndef_record_mirroring_ttM(UFR_HANDLE hndUFR, uint8_t message_nr, uint8_t *tnf, IN uint8_t *type_record, + uint8_t *type_length, IN uint8_t *id, uint8_t *id_length, IN uint8_t *payload, + uint32_t *payload_length, VAR uint8_t *card_formated, int use_uid_ascii_mirror, + int use_counter_ascii_mirror, int use_tt_message_mirror, uint32_t payload_mirroring_pos); + + /** + * @brief Multi reader support. Function returns the number of NDEF messages that have been read from the card, and number of NDEF records, number of NDEF empty messages. Also, function returns array of bytes containing number of messages pairs. First byte of pair is message ordinal, and second byte is number of NDEF records in that message. Message ordinal starts from 1. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_message_cnt pointer to the variable containing number of NDEF messages + * @param ndef_record_cnt pointer to the variable containing number of NDEF record + * @param ndef_record_array pointer to the array of bytes containing pairs (message ordinal - number of records) + * @param empty_ndef_message_cnt pointer to the variable containing number of empty messages + * + * @return Operation status + */ + UFR_STATUS DL_API get_ndef_record_countM(UFR_HANDLE hndUFR, VAR uint8_t *ndef_message_cnt, VAR uint8_t *ndef_record_cnt, + OUT uint8_t *ndef_record_array, VAR uint8_t *empty_ndef_message_cnt); + + /** + * @brief Multi reader support. Function deletes the last record of the selected message. If a message contains one record, then it will be written as an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_last_ndef_recordM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function deletes all records of the message, then writes an empty message. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message_nr NDEF message ordinal (starts form 1) + * + * @return Operation status + */ + UFR_STATUS DL_API erase_all_ndef_recordsM(UFR_HANDLE hndUFR, uint8_t message_nr); + + /** + * @brief Multi reader support. Function prepares the card for NDEF using. Function writes Capability Container (CC) if necessary, and writes empty message. If the card is MIFARE CLASSIC or MIFARE PLUS, then the function writes MAD (MIFARE Application Directory), and default keys and access bits for NDEF using. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ndef_card_initializationM(UFR_HANDLE hndUFR); + + //--------------------------------------------------------------------- + // Card emulation: + //--------------------------------------------------------------------- + + /** + * @brief Multi reader support. Function stores a message record for NTAG emulation mode into the reader. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 144 bytes. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefM(UFR_HANDLE hndUFR, uint8_t tnf, IN uint8_t *type_record, uint8_t type_length, IN uint8_t *id, + uint8_t id_length, IN uint8_t *payload, uint8_t payload_length); + + /** + * @brief Multi reader support. Put the reader permanently in a NDEF tag emulation mode. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling TagEmulationStop() function). + * In this mode, the reader can only answer to the commands issued by a following library functions: + * TagEmulationStart(), + * WriteEmulationNdef(), + * TagEmulationStop(), + * GetReaderSerialNumber(), + * GetReaderSerialDescription(), + * GetReaderHardwareVersion(), + * GetReaderFirmwareVersion(), + * GetBuildNumber() + * Calls to the other functions in this mode returns following error code: + * FORBIDDEN_IN_TAG_EMULATION_MODE = 0x90 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Allows the reader permanent exit from a NDEF tag emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API TagEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Puts the uFR reader into a permanently periodical switching from “NDEF tag emulation mode” to “tag reader mode”. Only way for a reader to exit from this mode is to receive the TAG_EMULATION_STOP command (issued by calling the TagEmulationStop() function). + * Much better control of the NFC device in a uFR proximity range can be achieved using Ad-Hoc emulation mode, described before. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_CombinedMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CombinedModeEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Put uFR in emulation mode with ad-hoc emulation parameters (see. SetAdHocEmulationParams() and GetAdHocEmulationParams() functions). uFR stays in ad-hoc emulation mode until AdHocEmulationStop() is called or reader reset. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStartM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Terminate uFR ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API AdHocEmulationStopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This function returns current ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15. + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15. + * + * @return Operation status + */ + UFR_STATUS DL_API GetAdHocEmulationParamsM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. This command set ad-hoc emulation parameters. On uFR power on or reset ad-hoc emulation parameters are set back to their default values. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel default value is 15. Could be in range from 0 to 15 + * @param ThresholdCollLevel default value is 7. Could be in range from 0 to 7 + * @param RFLevelAmp default value is 0. On uFR device should be 0 all the time. (1 for on, 0 for off). + * @param RxGain Could be in range from 0 to 7. + * @param RFLevel Could be in range from 0 to 15 + * + * @return Operation status + */ + UFR_STATUS DL_API SetAdHocEmulationParamsM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. Returns external field state when uFR is in ad-hoc emulation mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AdHocMode_M + * + * @param hndUFR handle of the uFR device + * @param is_field_present contains 0 if external field isn’t present or 1 if field is present. + * + * @return Operation status + */ + UFR_STATUS DL_API GetExternalFieldStateM(UFR_HANDLE hndUFR, VAR uint8_t *is_field_present); + + /** + * @brief Multi reader support. Put reader permanently in the mode that use shared RAM. After execution of this function, must be executed function TagEmulationStart. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EnterShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The permanent exit from mode that use shared RAM. After execution of this function, must be executed function TagEmulationStop. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ExitShareRamCommModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Function allows writing data to the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. Function allows read data from the shared RAM. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SharedRAM_M + * + * @param hndUFR handle of the uFR device + * @param ram_data pointer to data array + * @param addr address of first data in an array + * @param data_len length of array. Address + data_len <= 184 + * + * @return Operation status + */ + UFR_STATUS DL_API ReadShareRamM(UFR_HANDLE hndUFR, uint8_t *ram_data, uint8_t addr, uint8_t data_len); + + /** + * @brief Multi reader support. From library version 5.0.31, and firmware version 5.0.33 + * Function stores a message record for NTAG emulation mode into the reader in the RAM. Parameters of the function are: TNF, type of record, ID, payload. Maximum total size for emulated NDEF message is 1008 bytes. Unlike the function WriteEmulationNdef, the data is not written to the EEPROM of the reader, so they cannot be loaded after the reader is reset. This function must be called after reader reset to use the NTAG emulation. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_TagEmulationMode_M + * + * @param hndUFR handle of the uFR device + * @param tnf TNF of the record + * @param type_record pointer to the array containing record type + * @param type_length length of the record type + * @param id pointer to the array containing record ID + * @param id_length length of the record ID + * @param payload pointer to the array containing record payload + * @param payload_length length of the record payload + * + * @return Operation status + */ + UFR_STATUS DL_API WriteEmulationNdefRamM(UFR_HANDLE hndUFR, uint8_t tnf, uint8_t *type_record, uint8_t type_length, + uint8_t *id, uint8_t id_length, uint8_t *payload, uint32_t payload_length); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking_M + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureM(UFR_HANDLE hndUFR, IN uint8_t lpucECCSignature[ECC_SIG_LEN], OUT uint8_t lpucUid[MAX_UID_LEN], + VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * This function returns the ECC signature of the card chip UID. Card chip UID is signed using EC private key known only to a manufacturer. + * Unlike the ReadECCSignature function, this function supports ECC with variable length. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucECCSignatureLen pointer to ECC signature length + * @param lpucUid pointer to a chip UID (in case of successfully executed operation). Returned here for convenience. + * @param lpucUidLen pointer to variable which will (in case of successfully executed operation) receive true length of the returned UID. (Maximum UID length is 10 bytes but there is three possible UID sizes: 4, 7 and 10). + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API ReadECCSignatureExtM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucECCSignatureLen, + OUT uint8_t *lpucUid, VAR uint8_t *lpucUidLen, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used to read one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. In the initial Ultralight EV1 chip state, the counter values are set to 0. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param value Pointer to a uint32_t which will contained counter value after successful function execution. Since counters are 24-bit in length, most significant byte of the *value will be always 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, VAR uint32_t *value); + + /** + * @brief Multi reader support. This function is used to increment one of the three 24-bit one-way counters in Ultralight EV1 chip family. Those counters can’t be password protected. If the sum of the addressed counter value and the increment value is higher than 0xFFFFFF, the tag replies with an error and does not update the respective counter. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param counter_address Address of the target counter. Can be in range 0 to 2. Counters are mapped in a separate address space. + * @param inc_value Increment value. Only the 3 least significant bytes are relevant. + * + * @return Operation status + */ + UFR_STATUS DL_API IncrementCounterM(UFR_HANDLE hndUFR, uint8_t counter_address, uint32_t inc_value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counters in NTAG 213, NTAG 215 and NTAG 216 chips without using password authentication. If access to the NFC counter is configured to be password protected, this function will return COUNTER_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successfulfunction execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterM(UFR_HANDLE hndUFR, VAR uint32_t *value); // Same as ReadCounter(2, &value); + + /** + * @brief Multi reader support. This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param reader_key_index Index of the 6-byte key (PWD-PACK pair for this type of NFC tags) stored in the uFR reader. Can be in range 0 to 31. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_RKM(UFR_HANDLE hndUFR, VAR uint32_t *value, uint8_t reader_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * This function is used to read 24-bit NFC counter in NTAG 213, NTAG 215 and NTAG 216 chips using “reader key password authentication”. If access to NFC counter is configured to be password protected and PWD-PACK pair stored as a 6-byte key in uFR reader disagrees with PWD-PACK pair configured in tag, this function will return UFR_AUTH_ERROR. If access to NFC counter isn’t configured to be password protected, this function will return UFR_AUTH_ERROR. + * + * @ingroup Card_Tag_NTAG_2XX_M + * + * @param hndUFR handle of the uFR device + * @param value Pointer to a uint32_t which will contain counter value after successful function execution. Since counter is 24-bit in length, most significant byte of the *value will always be 0. + * @param key ointer to an array contains provided 6-byte key (PWD-PACK pair for this type of NFC tags) for password authentication. + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNFCCounterPwdAuth_PKM(UFR_HANDLE hndUFR, VAR uint32_t *value, IN const uint8_t *key); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. This function is used for the “Asynchronous UID sending” feature. Returned string contains hexadecimal notation of card ID with one mandatory suffix character and one optional prefix character. + * On the uFR Zero USB series there is an option to enable USB HID keyboard simulation. It is needed to set the baud rate to 0. For example, if baud rate is setted to any other value than 0, UID is sent to UART, but if it is setted to 0 UID is sent as keyboard simulation. + * Example: + * Card ID is 0xA103C256, prefix is 0x58 ('X'), suffix is 0x59 ('Y') + * Returned string is “XA103C256Y” + * Function sets configuration parameters for this feature. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Function sets the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable turn feature on/off (0/1) + * @param prefix_enable use prefix or not (0/1) + * @param prefix prefix character + * @param suffix suffix character + * @param send_removed_enable Turn feature on/off (0/1). If feature is enabled then Asynchronous UID will also be sent when removing a card from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate baud rate value (e.g. 9600) + * + * @return Operation status + */ + UFR_STATUS DL_API SetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, uint8_t send_enable, uint8_t prefix_enable, uint8_t prefix, uint8_t suffix, + uint8_t send_removed_enable, uint8_t reverse_byte_order, uint8_t decimal_representation, + uint32_t async_baud_rate); + + /** + * @brief Multi reader support. Returns info about parameters configured with previous function. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param async_baud_rate pointer to variable holding configured baud rate + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint32_t *async_baud_rate); + + /** + * @brief Multi reader support. Function returns the parameters of card ID sending. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending_M + * + * @param hndUFR handle of the uFR device + * @param send_enable pointer, if feature is on/off (0/1) + * @param prefix_enable pointer, if prefix is used or not (0/1) + * @param prefix pointer to variable holding prefix character + * @param suffix pointer to variable holding suffix character + * @param send_removed_enable Pointer. If value is 0 then feature is off. Otherwise, feature is on. If feature is enabled then Asynchronous UID is sent when the card is removed from the reader field. + * @param reverse_byte_order Turn feature on/off (0/1). If feature is disabled then the order of bytes (UID) will be as on card. If feature is enabled then the order of bytes will be reversed then the card’s order of bytes. + * @param decimal_representation Turn feature on/off (0/1). If feature is enabled then the UID will be presented as a decimal number. If feature is disabled then the UID will be presented as a hexadecimal number + * @param async_baud_rate pointer to baud rate variable + * + * @return Operation status + */ + UFR_STATUS DL_API GetAsyncCardIdSendConfigExM(UFR_HANDLE hndUFR, VAR uint8_t *send_enable, VAR uint8_t *prefix_enable, VAR uint8_t *prefix, + VAR uint8_t *suffix, VAR uint8_t *send_removed_enable, VAR uint8_t *reverse_byte_order, + VAR uint8_t *decimal_representation, VAR uint32_t *async_baud_rate); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to set custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode sets idle mode value + * @param card_detection_mode sets card detection mode value + * @param idle_color sets idle color + * @param card_detection_color sets card detection color + * @param enabled value that enables it (1) or disables it (0) + * + * @return Operation status + */ + UFR_STATUS DL_API SetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t idle_mode, uint8_t card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t enabled); + + /** + * @brief *uFR Zero series readers only + * Multi reader support. + * Function to get custom RGB UI signalization + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param idle_mode returns idle mode value + * @param card_detection_mode returns card detection mode value + * @param idle_color returns idle color + * @param card_detection_color returns card detection color + * @param enabled returns 1 if enabled, 0 if disabled + * + * @return Operation status + */ + UFR_STATUS DL_API GetCustomUiConfigM(UFR_HANDLE hndUFR, uint8_t *idle_mode, uint8_t *card_detection_mode, uint8_t *idle_color, uint8_t *card_detection_color, uint8_t *enabled); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_numberM(UFR_HANDLE hndUFR, VAR uint32_t *card_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, uint16_t last_reader_nr, + uint8_t start_hour, uint8_t start_minute, uint8_t end_hour, uint8_t end_minute, IN uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint16_t *first_reader_nr, + VAR uint16_t *last_reader_nr, VAR uint8_t *start_hour, VAR uint8_t *start_minute, + VAR uint8_t *end_hour, VAR uint8_t *end_minute, OUT uint8_t *days); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_erase_right_recordM(UFR_HANDLE hndUFR, uint8_t record_number); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_validate_recordM(UFR_HANDLE hndUFR, uint8_t begin_year, uint8_t begin_month, uint8_t begin_day, + uint8_t begin_hour, uint8_t begin_minute, uint8_t end_year, uint8_t end_month, uint8_t end_day, + uint8_t end_hour, uint8_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_validate_recordM(UFR_HANDLE hndUFR, VAR uint8_t *begin_year, VAR uint8_t *begin_month, VAR uint8_t *begin_day, + VAR uint8_t *begin_hour, VAR uint8_t *begin_minute, VAR uint8_t *end_year, + VAR uint8_t *end_month, VAR uint8_t *end_day, VAR uint8_t *end_hour, VAR uint8_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_typeM(UFR_HANDLE hndUFR, uint8_t card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_typeM(UFR_HANDLE hndUFR, VAR uint8_t *card_type); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_daily_durationM(UFR_HANDLE hndUFR, uint16_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_daily_durationM(UFR_HANDLE hndUFR, VAR uint16_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_card_total_durationM(UFR_HANDLE hndUFR, uint32_t duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_card_total_durationM(UFR_HANDLE hndUFR, VAR uint32_t *duration); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_credit_and_period_validityM(UFR_HANDLE hndUFR, VAR int32_t *credit, VAR uint32_t *begin_year, + VAR uint32_t *begin_month, VAR uint32_t *begin_day, VAR uint32_t *begin_hour, + VAR uint32_t *begin_minute, VAR uint32_t *end_year, VAR uint32_t *end_month, + VAR uint32_t *end_day, VAR uint32_t *end_hour, VAR uint32_t *end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_credit_and_period_validityM(UFR_HANDLE hndUFR, int32_t credit, uint32_t begin_year, uint32_t begin_month, + uint32_t begin_day, uint32_t begin_hour, uint32_t begin_minute, uint32_t end_year, + uint32_t end_month, uint32_t end_day, uint32_t end_hour, uint32_t end_minute); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, uint8_t right_record_type, IN uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_get_right_type_recordM(UFR_HANDLE hndUFR, uint8_t record_number, VAR uint8_t *right_record_type, + OUT uint8_t *right_data); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API ais_set_right_record_type_max_daily_counterM(UFR_HANDLE hndUFR, uint8_t record_number, uint16_t first_reader_nr, + uint16_t last_reader_nr, uint8_t start_hour, uint8_t start_minute, + uint8_t end_hour, uint8_t end_minute, IN uint8_t *days, + uint8_t max_daily_counter); + + //============================================================================= + + /** + * @brief Multi reader support. Electric strike switches when the function is called. Pulse duration determined by function. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param pulse_duration pulse_duration is strike switch on period in ms + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcLockOnM(UFR_HANDLE hndUFR, uint16_t pulse_duration); + + /** + * @brief Multi reader support. Function switches relay. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param state if the state is 1, then relay is switch on, and if state is 0, then relay is switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcRelayStateM(UFR_HANDLE hndUFR, uint8_t state); + + /** + * @brief Multi reader support. Function returns states of 3 IO pins. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param intercom shows that there is voltage at the terminals for intercom connection, or not + * @param door shows that the door's magnetic switch opened or closed + * @param relay_state is 1 if relay switch on, and 0 if relay switch off + * + * @return Operation status + */ + UFR_STATUS DL_API UfrXrcGetIoStateM(UFR_HANDLE hndUFR, VAR uint8_t *intercom, VAR uint8_t *door, VAR uint8_t *relay_state); + + /** + * @brief + * Multi reader support. Function controls the output pin on the reader. + * + * @ingroup ReaderAndLibrary_BaseHDUFR_M + * + * @param hndUFR handle of the uFR device + * @param output_nr ordinal number of hardware specific output pin + * @param invert 1 output is inverted, 0 output is normal + * @param cycle_nr Number of on-off cycles. If the cycle number is 0, the output state will be infinite, or until this will be changed with the next function call (output state is 1 if the invert is 0, and 0 if invert is 1). + * @param on_duration On duration in ms. If the invert is 0 output state is 1, and if invert is 1 output state is 0. + * @param off_duration Off duration in ms. If the invert is 0 output state is 0, and if invert is 1 output state is 1. This state of the output pin remains after the completion of the on-off cycle. + * + * @return Operation status + */ + UFR_STATUS DL_API UfrOutControlM(UFR_HANDLE hndUFR, uint8_t output_nr, uint8_t invert, uint8_t cycle_nr, uint8_t on_duration, uint8_t off_duration); + + /** + * @brief Multi reader support. This function turns Red LED only. + * If “light_status” value is 1, red light will be constantly turned on until receive “light_status “ value 0. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param light_status value 0 or 1 + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRedLightControlM(UFR_HANDLE hndUFR, uint8_t light_status); + + /** + * @brief Multi reader support. For classic uFR PLUS devices only. + * The function prohibits the blinking of the green diode (if this option is set), and sets color on RGB diodes. This color stays on diodes until this function sets the parameter "enable" to 0. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.55. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * + * @return Operation status + */ + UFR_STATUS DL_API RgbControlM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbExtLightControlM(UFR_HANDLE hndUFR, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.64. + * The function sets color on the RGB diodes. This setting will appear when the reader is in sleep mode. Function adjusts the period, and duration of impulse of light. The period is a product of approximately two seconds (2s, 4s, 6s, 8s,...). Maximal duration of impulse of light is 2000 ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period number of the 2 seconds period. (1 = 2s, 2 = 4s, 3 = 6s, …) + * @param duration duration of impulse of light in ms. + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlSleepM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint8_t period, uint16_t duration, uint8_t enable); + + /** + * @brief Multi reader support. From version 5.0.66. + * The function sets color on the RGB diodes, period of inactivity NFC RF and RGB, and duration of activity NFC RF and RGB. In the inactivity period NFC RF is off, and RGB light is off. In the activity period NFC RF is on, and RGB may be on. Function also sets the number of omitted activity periods, when the RGB light is off. For example if the inactivity period is 400ms, activity duration is 50ms, and number of omitted activity periods is 5, RGB lights will be on 50ms at every 2250ms. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param red value of red color (0 - 255) + * @param green value of green color (0 - 255) + * @param blue value of blue color (0 - 255) + * @param intensity value of color intensity in percent (0 - 100) + * @param period inactivity period in ms + * @param duration duration of activity period in ms + * @param rgb_omitted_cnt number of omitted activity periods + * @param enable 1 - enable 0 - disable + * + * @return Operation status + */ + UFR_STATUS DL_API UfrRgbLightControlRfPeriodM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue, uint8_t intensity, + uint16_t period, uint16_t duration, uint8_t rgb_omitted_cnt, uint8_t enable); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleSetM(UFR_HANDLE hndUFR, uint8_t red, uint8_t green, uint8_t blue); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbIdleDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows you to set the number of unsuccessful card selections before it can be considered that the card is not placed on the reader. Period between two card selections is approximately 10ms. Default value of this parameter is 20 i.e. 200ms. This parameter can be set in the range of 0 to 254. + * This is useful for asynchronous card ID transmission, if parameter send_removed_enable in function SetAsyncCardIdSendConfig is set. Then you can set a lower value of the number of unsuccessful card selections, in order to send information to the card removed was faster. + * A small value of this parameter may cause a false report that the card is not present, and immediately thereafter true report that the card is present. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrSetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, uint8_t bad_select_nr_max); + + /** + * @brief Multi reader support. The function returns value of maximal unsuccessful card selections, which is set in reader. + * + * @ingroup ReaderAndLibrary_M + * + * @param hndUFR handle of the uFR device + * @param bad_select_nr_max pointer to number of unsuccessful card selections + * + * @return Operation status + */ + UFR_STATUS DL_API UfrGetBadSelectCardNrMaxM(UFR_HANDLE hndUFR, VAR uint8_t *bad_select_nr_max); + + /** + * @brief Multi reader support. Turn the device into Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrEnterSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Wake up device from Sleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API UfrLeaveSleepModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Turn the device into Sleep mode after a certain amount of time. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepSetM(UFR_HANDLE hndUFR, uint8_t seconds_wait); + + /** + * @brief Multi reader support. Get status of AutoSleep mode. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_SleepAutoSleep_M + * + * @param hndUFR handle of the uFR device + * @param seconds_wait variable holding value of seconds to wait before entering into sleep. If the parameter is 0x00, the AutoSleep feature is turned off (default state). + * + * @return Operation status + */ + UFR_STATUS DL_API AutoSleepGetM(UFR_HANDLE hndUFR, VAR uint8_t *seconds_wait); + + /** + * @brief Multi reader support. This function is used for setting communication speed between reader and ISO144443-4 cards. For other card types, a default speed of 106 kbps is in use. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed setup value for transmit speed + * @param rx_speed setup value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeedPermanentlyM(UFR_HANDLE hndUFR, unsigned char tx_speed, unsigned char rx_speed); + + /** + * @brief Multi reader support. Returns baud rate configured with previous function. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param tx_speed pointer to variable, returns configured value for transmit speed + * @param rx_speed pointer to variable, returns configured value for receive speed + * + * @return Operation status + */ + UFR_STATUS DL_API GetSpeedParametersM(UFR_HANDLE hndUFR, VAR unsigned char *tx_speed, VAR unsigned char *rx_speed); + + /** + * @brief Multi reader support. Function enables sending data to the display. A string of data contains information about the intensity of color in each cell of the display. Each cell has three LED (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 16 cells, an array contains 48 bytes. Value of intensity is in range from 0 to 255. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayDataM(UFR_HANDLE hndUFR, IN uint8_t *display_data, uint8_t data_length); + + /** + * @brief Multi reader support. From version 5.0.55 + * Function has the same functionality as the function SetDisplayData. New feature is the RGB port selection. Internal port uses RGB diodes on the reader PCB. Card size reader has two diodes. XL reader has four diodes. External port uses LED RING with RGB diodes. + * Before the function calls, the function GreenLedBlinkingTurnOff must be called, or the reader is already in mode of blocking automatic signalization. Function sets the color of the RGB diodes. This color stays on the RGB until the function GreenLedBlinkingTurnOn is called. Intensity of light is defined by a parameter stored using the function SetRgbIntensity. + * + * @ingroup ReaderAndLibrary_RGBSignalization_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of data into array + * @param port_name EXTERNAL_RGB_PORT INTERNAL_RGB_PORT + * + * @return Operation status + */ + UFR_STATUS DL_API SetRgbDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint8_t port_name); + + /** + * @brief Multi reader support. This function plays constant sound of “frequency” Hertz. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * @param frequency frequency in Hz To stop playing sound, send 0 value for “frequency”. + * + * @return Operation status + */ + UFR_STATUS DL_API SetSpeakerFrequencyM(UFR_HANDLE hndUFR, uint16_t frequency); + + /** + * @brief Multi reader support. SetRgbIntensity (alias from version 5.0.55) + * Function sets the intensity of light on the display. Value of intensity is in the range 0 to 100. This value writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API SetDisplayIntensityM(UFR_HANDLE hndUFR, uint8_t intensity); + + /** + * @brief Multi reader support. GetRgbIntensity (alias from version 5.0.55) + * Function gets the intensity of light on the display. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_DisplayControl_M + * + * @param hndUFR handle of the uFR device + * @param intensity value of intensity (0 - 100) + * + * @return Operation status + */ + UFR_STATUS DL_API GetDisplayIntensityM(UFR_HANDLE hndUFR, VAR uint8_t *intensity); + + // ############################################################################# + // ############################################################################# + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_ModeM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Call SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS(). ISO 14443-4 tag in a field will be selected and RF field polling will be stopped. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ats After successful function execution, buffer on which this pointer points to will contain ATS returned from the TAG (historical bytes included). Before calling this function, you have to allocate MAX_ATS_LEN bytes for the ats buffer. MAX_ATS_LEN macro is defined in uFCoder.h (#define MAX_ATS_LEN 25). + * @param ats_len After successful function execution, variable on which this pointer points to will contain actual ATS length. + * @param uid After successful call to this function, buffer on which this pointer points to will contain TAG UID. Before calling this function, you have to allocate MAX_UID_LEN bytes for the ats buffer. MAX_UID_LEN macro is defined in uFCoder.h (#define MAX_UID_LEN 10). + * @param uid_len After successful function execution, variable on which this pointer points to will contain actual UID length. + * @param sak After successful function execution, variable on which this pointer points to will contain SAK (Select Acknowledge) of the TAG in field. + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_Mode_GetATSM(OUT UFR_HANDLE hndUFR, uint8_t ats[MAX_ATS_LEN], VAR uint8_t *ats_len, + OUT uint8_t uid[MAX_UID_LEN], VAR uint8_t *uid_len, VAR uint8_t *sak); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API SetISO14443_4_DLStorageM(UFR_HANDLE hndUFR); + + /** + * @brief DEPRECATED + */ + UFR_STATUS DL_API uFR_i_block_transceiveM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR size_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint32_t *ufr_status); + /** + * @brief Multi reader support. + * Used to transmit C-APDU and receive R-APDU packets per defined parameters + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls APDU CLA (class byte) + * @param ins APDU command code (instruction byte) + * @param p1 parameter byte + * @param p2 parameter byte + * @param data_out APDU command data field. Use NULL if data_out_len is 0 + * @param data_out_len number of bytes in the APDU command data field (Lc field) + * @param data_in buffer for receiving APDU response. There should be allocated at least (send_le + 2) bytes before function call. + * @param max_data_in_len size of the receiving buffer. If the APDU response exceeded size of buffer, then function returns error + * @param response_len value of the Le fied if send_le is not 0. After successful execution location pointed by the response_len will contain number of bytes in the APDU response. + * @param send_le if this parameter is 0 then APDU Le field will not be sent. Otherwise Le field will be included in the APDU message. Value response_len pointed to, before function call will be value of the Le field. + * @param apdu_status APDU error codes SW1 and SW2 in 2 bytes array + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_TransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN uint8_t *data_out, + uint8_t data_out_len, OUT uint8_t *data_in, uint32_t max_data_in_len, VAR uint32_t *response_len, + uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * Sends C–APDU in the c_string (zero terminated) format, containing pairs of the + hexadecimal digits. Pairs of the hexadecimal digits can be delimited by any of the punctuation + characters or white space. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu C_APDU as string + * @param r_apdu R_APDU returned as string + * + * @return Operation status + */ + UFR_STATUS DL_API APDUHexStrTransceiveM(UFR_HANDLE hndUFR, IN const char *c_apdu, OUT char **r_apdu); + + /** + * @brief Multi reader support. + * Binary alternative function to the APDUHexStrTransceive(). C-APDU and R-APDU are + sent and receive in the form of the byte arrays. There is obvious need for a c_apdu_len and + *r_apdu_len parameters which represents length of the *c_apdu and *r_apdu byte arrays, + respectively + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, OUT uint8_t *r_apdu, + VAR uint32_t *r_apdu_len); + + /** + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param c_apdu Array containing the C-APDU + * @param c_apdu_len length of the c_apdu array + * @param r_apdu Array containing received R-APDU + * @param r_apdu_len length of the received r_apdu array + * + * @return Operation status + */ + UFR_STATUS DL_API APDUPlainTransceiveToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *c_apdu, uint32_t c_apdu_len, VAR uint8_t **r_apdu, VAR uint32_t *r_apdu_len); + + /** + * @brief Multi reader support. + * This is “exploded binary” alternative function intended for support APDU commands in ISO 14443- + 4A tags. APDUTransceive() receives separated parameters which are an integral part of the C– + APDU. There are parameters cls, ins, p0, p1 of the uint8_t type. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param cls lcs + * @param ins ins + * @param p1 p1 + * @param p2 p2 + * @param data_out data_out + * @param Nc Nc + * @param data_in data_in + * @param Ne Ne + * @param send_le send_le + * @param apdu_status apdu_status + * + * @return Operation status + */ + UFR_STATUS DL_API APDUTransceiveM(UFR_HANDLE hndUFR, uint8_t cls, uint8_t ins, uint8_t p1, uint8_t p2, IN const uint8_t *data_out, + uint32_t Nc, OUT uint8_t *data_in, VAR uint32_t *Ne, uint8_t send_le, OUT uint8_t *apdu_status); + + /** + * @brief Multi reader support. + * I-block used to convey information for use by the application layer + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param chaining 1 - chaining in use, 0 - no chaining + * @param timeout timeout for card reply + * @param block_length inf block length + * @param snd_data_array pointer to array of data that will be send + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API i_block_trans_rcv_chainM(UFR_HANDLE hndUFR, uint8_t chaining, uint8_t timeout, uint8_t block_length, + IN uint8_t *snd_data_array, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * R-block used to convey positive or negative acknowledgements. An R-block never contains an INF field. The acknowledgement relates to the last received block. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param ack 1 ACK, 0 NOT ACK + * @param timeout timeout for card reply + * @param rcv_length length of received data + * @param rcv_data_array pointer to array of data that will be received + * @param rcv_chained 1 received packet is chained, 0 received packet is not chained + * @param ufr_status card operation status + * + * @return Operation status + */ + UFR_STATUS DL_API r_block_transceiveM(UFR_HANDLE hndUFR, uint8_t ack, uint8_t timeout, VAR uint8_t *rcv_length, OUT uint8_t *rcv_data_array, + VAR uint8_t *rcv_chained, VAR uint32_t *ufr_status); + + /** + * @brief Multi reader support. + * Used to deselect tag and restore RF field polling. This call is mandatory after using SetISO14443_4_Mode() and its variants. + * + * @ingroup Card_Tag_CardFeatures_ISO144434_4_M + * + * @param hndUFR handle of the uFR device + * @param timeout timeout in [ms] + * + * @return Operation status + */ + UFR_STATUS DL_API s_block_deselectM(UFR_HANDLE hndUFR, uint8_t timeout); + + /** + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param card_activate card_activate + * @param card_halted card_halted + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param crypto1 crypto1 + * @param timeout timeout + * @param tx_data tx_data + * @param tx_data_len tx_data_len + * @param rx_data rx_data + * @param rx_data_len rx_data_len + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceiveM(UFR_HANDLE hndUFR, uint8_t card_activate, uint8_t card_halted, uint8_t tx_crc, uint8_t rx_crc, + uint8_t crypto1, uint32_t timeout, IN uint8_t *tx_data, uint8_t tx_data_len, OUT uint8_t *rx_data, + VAR uint8_t *rx_data_len); + + /** + * @brief Multi reader support. Function sets the parameters for transceive mode. If the hardware CRC option is used, then only command bytes are sent to the card (hardware will add two bytes of CRC to the end of the RF packet). If this option did not use, then command bytes and two bytes of CRC sent to card (i.e. ISO14443 typeA CRC). Timeout for card response in us sets. + * Card is selected and waiting for commands. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param tx_crc hardware RF TX crc using (1 - yes, 0 - no) + * @param rx_crc hardware RF RX crc using (1 - yes, 0 - no) + * @param rf_timeout timeout for card response in us + * @param uart_timeout timeout for UART response in ms + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_startM(UFR_HANDLE hndUFR, uint8_t tx_crc, uint8_t rx_crc, uint32_t rf_timeout, uint32_t uart_timeout); + + /** + * @brief Multi reader support. + * The function returns the reader to normal mode. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_transceive_mode_stopM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function enables normal working mode of reader, after leaving the transceive working mode with blocking card HALT command in the main loop. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API card_halt_enableM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function sends data through the serial port to the card. + * + * @ingroup Card_Tag_CardFeatures_TransceiveMode_M + * + * @param hndUFR handle of the uFR device + * @param send_data pointer to data array for sending to card + * @param send_len number of bytes for sending + * @param rcv_data pointer to data array received from card + * @param bytes_to_receive expected number of bytes received from card + * @param rcv_len number of bytes received from card + * + * @return Operation status + */ + UFR_STATUS DL_API uart_transceiveM(UFR_HANDLE hndUFR, IN uint8_t *send_data, uint8_t send_len, OUT uint8_t *rcv_data, + uint32_t bytes_to_receive, VAR uint32_t *rcv_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * After the successfully executed function, the same APDU commands as for ISO14443-4 tags can be used, but not at the same time. + * Note. This function is used for NXP SAM AV2 activation, and unlocking if SAM is locked. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API open_ISO7816_interfaceM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function activates the smart card and returns an ATR (Answer To Reset) array of bytes from the smart card. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * @param atr_data pointer to array containing ATR + * @param atr_len pointer to ATR length variable + * + * @return Operation status + */ + UFR_STATUS DL_API Open_ISO7816_GenericM(UFR_HANDLE hndUFR, OUT uint8_t *atr_data, VAR uint8_t *atr_len); + + /** + * @brief Multi reader support. + * Function switches the use of APDU to ISO7816 interface. The smart card must be in the active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are not used. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_no_APDUM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function deactivates the smart card. APDU commands are used by ISO 14443-4 tags. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API close_ISO7816_interface_APDU_ISO14443_4M(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Function switches the use APDU to ISO14443-4 tags. The smart card stays in active state. Tag must already be in ISO 14443-4 mode. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_to_ISO14443_4_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * APDU commands are not used. The smart card stays in active state. + * + * @ingroup Card_Tag_CardFeatures_ISO7816_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API APDU_switch_off_from_ISO7816_interfaceM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. + * Using this function you can select the appropriate application on the card. For the DLSigner JCApp AID should be 'F0 44 4C 6F 67 69 63 00 01'. For the DLStorage JCApp AID should be 'F0 44 4C 6F 67 69 63 01 01'. Before calling this function, the NFC tag must be in ISO 14443-4 mode. For entering ISO 14443-4 mode use the SetISO14443_4_Mode() or SetISO14443_4_Mode_GetATS() function. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param aid Pointer to array containing AID (Application ID) i.e: "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01" for the DLSigner or "\xF0\x44\x4C\x6F\x67\x69\x63\x01\x01" for the DLStorage JCApp. + * @param aid_len Length of the AID in bytes (9 for the DLSigner or DLStorage JCApps). + * @param selection_response On Application successful selection, the card returns 16 bytes. In the current version only the first of those bytes (i.e. byte with index 0) is relevant and contains JCApp card type which is 0xA0 for actual revision. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSelectByAidM(UFR_HANDLE hndUFR, IN const uint8_t *aid, uint8_t aid_len, OUT uint8_t selection_response[16]); + + /** + * @brief Multi reader support. In JCApp cards you can put two types of asymmetric crypto keys. Those are RSA and ECDSA private keys, three of each. Before you can use a JCApp card for digital signing you have to put an appropriate private key in it. There is no way to read out private keys from the card. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This feature is disabled in the regular DLSigner JCApp. To acquire cards with this feature enabled you have to contact your supplier with a special request. + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param key_type 0 for RSA private key and 1 for ECDSA private key. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param key Pointer to array containing key bytes. + * @param key_bit_len Key length in bits. + * @param key_param Reserved for future use (RFU). Use null for this parameter. + * @param key_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutPrivateKeyM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, IN const uint8_t *key, uint16_t key_bit_len, + const IN uint8_t *key_param, uint16_t key_parm_len); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_type key_type + * @param key_index key_index + * @param key_designator key_designator + * @param key_bit_len key_bit_len + * @param params params + * @param params_size params_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateKeyPairM(UFR_HANDLE hndUFR, uint8_t key_type, uint8_t key_index, uint8_t key_designator, + uint16_t key_bit_len, IN const uint8_t *params, uint16_t params_size); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteRsaKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppDeleteEcKeyPairM(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param chunk Pointer to array containing first chunk of data. + * @param chunk_len Length of the first chunk of data (max. 255). + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureBeginM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *chunk, uint16_t chunk_len, IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param chunk Pointer to an array containing one of the chunks of data. + * @param chunk_len Length of the current one of the remaining chunks of data (max. 255). + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureUpdateM(UFR_HANDLE hndUFR, IN const uint8_t *chunk, uint16_t chunk_len); + + /** + * @brief Multi reader support. Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param sig_len Pointer to a 16-bit value in which you will get length of the signature in case of a successful executed chain of function calls, described in the introduction of this topic. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppSignatureEndM(UFR_HANDLE hndUFR, VAR uint16_t *sig_len); + + /** + * @brief Multi reader support. + * This function virtually combines three successive calls of functions JCAppSignatureBegin(), JCAppSignatureUpdate() and JCAppSignatureEnd() and can be used in case your data for signing have 255 bytes or less. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with a User PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param cipher 0 for the RSA private key and 1 for the ECDSA. + * @param digest 0 for none digest (not supported with ECDSA) and 1 for SHA1 + * @param padding 0 for none (not supported with RSA) and 1 for pads the digest according to the PKCS#1 (v1.5) scheme. + * @param key_index For each of the card types there are 3 different private keys that you can set. Their indexes are from 0 to 2. + * @param plain_data Pointer to array containing data for signing. + * @param plain_data_len Length of the data for signing (max. 255). + * @param sig_len Pointer to a 16-bit value in which you will get the length of the signature in case of successful execution. + * @param alg_param Reserved for future use (RFU). Use null for this parameter. + * @param alg_parm_len Reserved for future use (RFU). Use 0 for this parameter. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGenerateSignatureM(UFR_HANDLE hndUFR, uint8_t cipher, uint8_t digest, uint8_t padding, uint8_t key_index, + IN const uint8_t *plain_data, uint16_t plain_data_len, VAR uint16_t *sig_len, + IN const uint8_t *alg_param, uint16_t alg_parm_len); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj Pointer to an array containing an object (certificate). + * @param obj_size Length of the object (certificate). + * @param id Pointer to an array containing object id. Object id is a symbolic value and has to be unique on the card. + * @param id_size Length of the object id. Minimum object id length can be 1 and maximum 253. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *obj, int16_t obj_size, IN uint8_t *id, + uint8_t id_size); + + /** + * @brief Multi reader support. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling of this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject Pointer to an array containing subject. Subject is a symbolic value linked to an appropriate certificate by the same obj_type and index. + * @param size Length of the subject. Maximum subject length is 255. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPutObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, IN uint8_t *subject, uint8_t size); + + /** + * @brief Multi reader support. + * Using this function you can delete certificate objects from a card. This includes subjects linked to a certificate. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppInvalidateCertM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index); + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param id When id == NULL, the function returns id_size. + * @param id_size Before second call, *id_size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjIdM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *id, VAR uint16_t *id_size); // when id == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set the parameter subject to null and you will get the size of the obj_type at obj_index. Before the second call you have to allocate an array of returned size bytes and pass that array using parameter subject. Before second call, *size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param subject When subject == NULL, function returns size. + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjSubjectM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *subject, VAR uint16_t *size); // when subject == NULL returns size + + /** + * @brief Multi reader support. + * This function you always have to call 2 times. Before the first call you have to set parameter id to null and you will get the id_size of the obj_type at obj_index. Before the second call you have to allocate an array of the returned id_size bytes and pass that array using parameter id. Before second call, *id_size should be set to a value of the exact bytes allocated. + * Before calling this function, NFC tag must be in ISO 14443-4 mode and JCApp should be selected using JCAppSelectByAid() with AID = "\xF0\x44\x4C\x6F\x67\x69\x63\x00\x01". + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * + * @param hndUFR handle of the uFR device + * @param obj_type 0 for certificate containing RSA public key, 1 for certificate containing ECDSA public key and 2 for the CA (certificate authority). + * @param obj_index For each of the certificates containing RSA or ECDSA public keys there are 3 different corresponding private keys that should be set before placing the certificates themselves. Their indexes are from 0 to 2. For CA there are 12 memory slots so their indexes can be from 0 to 11. + * @param obj When obj == NULL, function returns size + * @param size Before second call, *size should be set to a value of the exact bytes allocated. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetObjM(UFR_HANDLE hndUFR, uint8_t obj_type, uint8_t obj_index, OUT uint8_t *obj, int16_t size); // when obj == NULL returns size + + /** + * @brief Multi reader support. + * This function is used to login to the JCApp with an appropriate PIN code. Every time you deselect the JCApp tag either by calling s_block_deselect(), ReaderReset(), ReaderClose() or because of the loss of the NFC field, in order to communicate with the same tag you have to select JCApp and login again, using this function. + * Every successful login resets the incorrectly entered PIN code counter for the PIN code specified by the SO parameter. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to login as a User. If this parameter has a value different then 0, the function will try to login as a Security Officer (SO). + * @param pin Pointer to the array of bytes which contains PIN code. + * @param pinSize Effective size of the array of bytes which contains PIN code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppLoginM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *pin, uint8_t pinSize); + + /** + * @brief Multi reader support. This function is used to get how many of the unsuccessful login attempts remain before specified PIN or PUK code will be blocked. + * This function have parameter of the type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN code type (see the dl_sec_code_t type definition above, in the text) + * @param triesRemaining Pointer to the 16-bit unsigned integer which will contain the number of the unsuccessful login attempts remains before specified PIN code will be blocked, in case of successful function execution. If this value is 0 then the specified PIN code is blocked. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetPinTriesRemainingM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, VAR uint16_t *triesRemaining); + + /** + * @brief Multi reader support. This function is used to change the PIN or PUK code which type is specified with secureCodeType parameter of type dl_sec_code_t which is defined as: + * typedef enum { + * USER_PIN = 0, + * SO_PIN, + * USER_PUK, + * SO_PUK + * } dl_sec_code_t; + * Prior to calling this function you have to be logged in with an SO PIN code. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param secureCodeType Specifies the PIN or PUK code type you wish to change (see the dl_sec_code_t type definition above, in the text) + * @param newPin Pointer to the array of bytes which contains a new code + * @param newPinSize Effective size of the array of bytes which contains a new code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinChangeM(UFR_HANDLE hndUFR, dl_sec_code_t secureCodeType, IN uint8_t *newPin, uint8_t newPinSize); + + /** + * @brief Multi reader support. + * This function is used to unblock PIN code which is specified by the SO parameter. + * This function does not require to be logged in with any of the PIN codes. + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * + * @param hndUFR handle of the uFR device + * @param SO If this parameter has value 0 function will try to unblock User PIN code. If this parameter has a value different then 0, the function will try to unblock SO PIN code. + * @param puk Pointer to the array of bytes which contains PUK code. + * @param pukSize Effective size of the array of bytes which contains PUK code. + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinUnblockM(UFR_HANDLE hndUFR, uint8_t SO, IN uint8_t *puk, uint8_t pukSize); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinEnableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_Common_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param SO SO + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppPinDisableM(UFR_HANDLE hndUFR, uint8_t SO); + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param modulus modulus + * @param modulus_size modulus_size + * @param exponent exponent + * @param exponent_size exponent_size + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetRsaPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *modulus, VAR uint16_t *modulus_size, + OUT uint8_t *exponent, VAR uint16_t *exponent_size); // when modulus == NULL, returns sizes and exponent ignored + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param keyW keyW + * @param keyWSize keyWSize + * @param field field + * @param field_size field_size + * @param ab ab + * @param ab_size ab_size + * @param g g + * @param g_size g_size + * @param r r + * @param r_size r_size + * @param k k + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcPublicKeyM(UFR_HANDLE hndUFR, uint8_t key_index, OUT uint8_t *keyW, VAR uint16_t *keyWSize, OUT uint8_t *field, + VAR uint16_t *field_size, OUT uint8_t *ab, VAR uint16_t *ab_size, OUT uint8_t *g, + VAR uint16_t *g_size, OUT uint8_t *r, VAR uint16_t *r_size, VAR uint16_t *k, + VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); // when keyW == NULL, returns size + + /** + * + * @ingroup Card_Tag_JavaCardApplication_PKIAndDigitalSignature_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_index key_index + * @param key_size_bits key_size_bits + * @param key_designator key_designator + * + * @return Operation status + */ + UFR_STATUS DL_API JCAppGetEcKeySizeBitsM(UFR_HANDLE hndUFR, uint8_t key_index, VAR uint16_t *key_size_bits, VAR uint16_t *key_designator); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * This function has to be called before JCStorageListFiles() to acquire the size of the array of bytes needed to be allocated for the list of currently existing files on the DLStorage card. Maximum files on the DLStorage card is 16. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list_size Pointer to the 32-bit unsigned integer which will contain the size of the array of bytes needed to be allocated prior to calling the JCStorageListFiles() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFilesListSizeM(UFR_HANDLE hndUFR, VAR uint32_t *list_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFilesListSize() function and getting the size of the list of the currently existing files on the DLStorage card, and if the list size is greater than 0, you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the list parameter will contain indexes of the existing files on the card. Maximum files on the DLStorage card is 16. Each byte of the array pointed by the list parameter contains a single index of the existing file on the DLStorage card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param list Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFilesListSize() function. + * @param list_bytes_allocated Size of the array of bytes pointed by the list parameter. Have to be equal to the value of the *list_size acquired by the previous call to JCStorageGetFilesListSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageListFilesM(UFR_HANDLE hndUFR, OUT uint8_t *list, uint32_t list_bytes_allocated); + + /** + * @brief Multi reader support. + * This function returns file size indexed by the parameter card_file_index, on successful execution. Returned file size is in bytes. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. You have to know file size to allocate an appropriate amount of data prior to calling the JCStorageReadFile() function. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file which size we want to get + * @param file_size Pointer to the 32-bit unsigned integer which will contain size in bytes of the file having card_file_index. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageGetFileSizeM(UFR_HANDLE hndUFR, uint8_t card_file_index, VAR uint32_t *file_size); + + /** + * @brief Multi reader support. + * After calling the JCStorageGetFileSize() function and getting the size of the file on the DLStorage card you can allocate a convenient array of bytes and then call this function. On successful function execution, the array pointed by the data parameter will contain file content. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param data Pointer to the allocated array of bytes of the size acquired by the previous call to JCStorageGetFileSize() function. + * @param data_bytes_allocated d Size of the array of bytes pointed by the data parameter. Have to be equal to the value of the *file_size acquired by the prior calling JCStorageGetFileSize() function. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, OUT uint8_t *data, uint32_t data_bytes_allocated); + + /** + * @brief Multi reader support. + * This function reads a file from the DLStorage card directly to the new file on the host file-system. If the file on the host file system already exists, it will be overwritten. If the file with the index defined by the card_file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to read. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the new file on the host file-system which will contain the data read from the file on the card in case of successful function execution. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageReadFileToFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * This function creates a file on the DLStorage card and writes an array of bytes pointed by the data parameter to it. Parameter data_size defines the amount of data to be written in the file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file we want to create and write data to it. + * @param data Pointer to the data i.e. array of bytes to be written into the new file on the card. + * @param data_size Size, in bytes, of the data to be written into the file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const uint8_t *data, uint32_t data_size); + + /** + * @brief Multi reader support. + * This function writes file content from the host file-system to the new file on the DLStorage card. If the file with the index defined by the card_file_index parameter already exists on the card, the function will return UFR_APDU_SW_ENTITY_ALREADY_EXISTS (0x000A6A89) error code. Maximum files on the DLStorage card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If there is an error during the writing procedure, for example because of the loss of the NFC field and the file is only partially written (tearing event), a corrupted file on the DLStorage card should be deleted and then written again. Therefore we suggest you to always do verification of the data written to the card. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param card_file_index It should contain an index of the file on the card we want to create and write content of the file from the host file-sistem to it. + * @param file_system_path_name Pointer to the null-terminated string that should contain path and the name of the file from the host file-sistem whose content we want to transfer to the new file on the card. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageWriteFileFromFileSystemM(UFR_HANDLE hndUFR, uint8_t card_file_index, IN const char *file_system_path_name); + + /** + * @brief Multi reader support. + * After successful call to this function, the file on the DLStorage card will be deleted. Maximum files on the card is 16 and file indexes are zero-based so indexes can be in the range of 0 to 15. If a file with index defined by the file_index parameter does not exist, the function will return UFR_APDU_SW_FILE_NOT_FOUND (0x000A6A82) error code. + * + * @ingroup Card_Tag_JavaCardApplication_DLStorage_M + * + * @param hndUFR handle of the uFR device + * @param file_index It should contain an index of the file we want to delete. + * + * @return Operation status + */ + UFR_STATUS DL_API JCStorageDeleteFileM(UFR_HANDLE hndUFR, uint8_t file_index); + + //------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. + * Use this function to authenticate to the eMRTD NFC tag using BAC. This function establishes a security channel for communication. Security channel is maintained using send_sequence_cnt parameter and channel session keys are ksenc (for encryption) and ksmac (for calculating MAC). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param mrz_proto_key MRZ proto-key acquired using prior call to MRTD_MRZDataToMRZProtoKey() or MRTD_MRZSubjacentToMRZProtoKey() function. + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt After successful execution of this function, the pointer to this 64-bit value should be saved and forwarded at every subsequent call to MRTDFileReadBacToHeap() and/or other functions for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDAppSelectAndAuthenticateBacM(UFR_HANDLE hndUFR, IN const uint8_t mrz_proto_key[25], OUT uint8_t ksenc[16], + OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * Use this function to read files from the eMRTD NFC tag. You can call this function only after successfully established security channel by the previously called + * MRTDAppSelectAndAuthenticateBac() function. Session keys ksenc and ksmac, and also parameter send_sequence_cnt are acquired by the previously called + * MRTDAppSelectAndAuthenticateBac() function. After the successful call to this function, *output points to the file data read from an eMRTD file specified by the file_index parameter. Buffer, in which the data is stored, is automatically allocated on the memory heap during function execution. Maximum amount of data allocated can be 32KB. User is obligated to cleanup allocated data space, occupied by the *output, after use (e.g. by calling DLFree() or directly free() from the C/C++ code). + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param file_index file index + * @param output buffer that storese output + * @param output_length length of the returned output + * @param ksenc This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session encryption key after successful function execution. + * @param ksmac This array must have allocated at least 16 bytes prior to calling this function. This array will contain a session key for calculating MAC after successful function execution. + * @param send_sequence_cnt send_sequence_cnt + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDFileReadBacToHeapM(UFR_HANDLE hndUFR, IN const uint8_t *file_index, VAR uint8_t **output, OUT uint32_t *output_length, + IN const uint8_t ksenc[16], IN const uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + + /** + * @brief Multi reader support. + * This function validates data groups read from the eMRTDocument. All the elements needed for a validation are recorded into the eMRTD and additional CSCA certificate (Country Signing Certificate Authority). During function execution, hash values of the data groups are validated. Data groups hash values have to be the same as those values embedded in the SOD file which is signed by the private key corresponding to the DS certificate. The DS certificate has to be included in the SOD file too. SOD content is a special case of the PKCS#7 ASN.1 DER encoded structure. Finally, DS certificate signature is validated by the external CSCA certificate which is proof of the valid certificates chain of thrust. + * The countries provided their CSCA certificates on the specialized Internet sites. CSCA certificates can be in PEM (base64 encoded) or binary files (there having extensions such as PEM, DER, CER, CRT…). Some countries have Master List files that include certificates from other countries with which they have bilateral agreements. Those Master List files have an “.ml” file extension. Additionally, the ICAO Public Key Directory (PKD) is a central repository for exchanging the information required to authenticate ePassports. For more details you can visit the ICAO PKD web site. + * ________________ + * + * @ingroup Card_Tag_CardFeatures_MRTD_M + * + * @param hndUFR handle of the uFR device + * @param cert_storage_folder Pointer to the zero terminated string which should contains path to the folder containing CSCA certificates and/or ICAO Master List files. + * @param out_str After successful function execution, this pointer will point to the pointer on the zero terminated string containing verbose printout of the validation steps. Various printout details are determined by the value of the verbose_level function parameter. + * @param endln Pointer to the zero terminated string which contains the new line escape sequence for the target system. In the general case it should be "\n" but on some systems can be "\r" or "\r\n". + * @param verbose_level One of the values defined in the E_PRINT_VERBOSE_LEVELS enumeration: enum E_PRINT_VERBOSE_LEVELS { PRINT_NONE, PRINT_ESSENTIALS, PRINT_DETAILS, PRINT_ALL_PLUS_STATUSES, }; + * @param ksenc Session encryption key acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param ksmac Session key for calculating MAC acquired using prior call to MRTDAppSelectAndAuthenticateBac() function. + * @param send_sequence_cnt This pointer should point to a 64-bit value initialized by the previously successful call to MRTDAppSelectAndAuthenticateBac() function. Pointer to this 64-bit value should be saved and forwarded at every subsequent call to this function and/or other functions used for reading eMRTD. + * + * @return Operation status + */ + UFR_STATUS DL_API MRTDValidateM(UFR_HANDLE hndUFR, IN const char *cert_storage_folder, VAR char **out_str, IN const char *endln, + uint32_t verbose_level, OUT uint8_t ksenc[16], OUT uint8_t ksmac[16], VAR uint64_t *send_sequence_cnt); + // ############################################################################# + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Start(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StartM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_Stop(void); + + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_DESFIRE_StopM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Start(void); // Alias for uFR_DESFIRE_Start() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StartM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StartM() + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_Stop(void); // Alias for uFR_DESFIRE_Stop() + /** + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_APDU_StopM(UFR_HANDLE hndUFR); // Alias for uFR_DESFIRE_StopM() + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUidM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, OUT uint8_t *card_uid, + VAR uint8_t *card_uid_len, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3desM(UFR_HANDLE hndUFR, IN uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * Provided Key mode (PK) + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit AES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 64 bit DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_GetDesfireUid_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUidDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief This function returns Unique ID of card, if the Random ID is used. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Mifare Desfire EV1 card can be configured to use Random ID numbers instead Unique ID numbers during anti-collision procedure. In this case card uses single anti-collision loop, and returns Random Number Tag 0x08 and 3 bytes Random Number (4 bytes Random ID). + * From library version 5.0.29. and firmware version 5.0.32, Desfire Light card supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_nr key number into application (0 for card master key or application master key) + * @param card_uid pointer to array containing card UID + * @param card_uid_len pointer to card UID length variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_GetDesfireUid2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, VAR uint8_t *card_uid_len, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function returns the available bytes on the card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param free_mem_byte pointer to free memory size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFreeMemM(UFR_HANDLE hndUFR, VAR uint32_t *free_mem_byte, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCardM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * Provided Key mode (PK) + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit AES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 64 bit DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireFormatCard_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCardDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function releases all allocated user memory on the card. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * All applications will be deleted, also all files within those applications will be deleted. Only the card master key, and card master key settings will not be deleted. This operation requires authentication with the card master key. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireFormatCard2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [a] + * @param write_key_no key for writing [b] + * @param read_write_key_no key for reading and writing [c] + * @param change_key_no key for changing this setting [d] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.81. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [i] + * @param write_key_no key for writing [j] + * @param read_write_key_no key for reading and writing [k] + * @param change_key_no key for changing this setting [l] + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + /** + * @brief Multi reader support. Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Provided Key mode (PK) + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Desfire EV3 only. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 – 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * Secure Dynamic Message can be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. Communication settings define communication mode between reader and card. The communication modes are: - plain communication communication settings value is 0x00 - plain communication secured by MACing communication settings value is 0x01 - fully enciphered communication communication settings value is 0x03 Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, uint16_t iso_file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. From library version 5.0.96, and firmware version 5.0.81. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * ISO/IEC 7816-4 File ID for the file to be created. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param iso_file_id ISO/IEC 7816-4 File ID for the file to be created + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateStdDataFile_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, uint16_t iso_file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t file_size, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Function allows to create a file for the storage of unformatted user data within an existing application on the card. Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain keys within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If the value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * Due to the mirror image a BackupDataFile always consumes double quantity of the card’s memory compared to a StandardDataFile with the same specified file size. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param file_size file size in bytes + * @param read_key_no key for reading [m] + * @param write_key_no key for writing [n] + * @param read_write_key_no key for reading and writing [o] + * @param change_key_no key for changing this setting [p] + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t file_size, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * Provided Key mode (PK) + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit AES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 64 bit DES key provided key + * Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 128 bit 2K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * 192 bit 3K3DES key provided key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function deactivates a file within the currently selected application. + * + * Multi reader support. + * No authentication + * Allocated memory blocks associated with deleted file not set free. Only format card function can delete the memory blocks. Is the application master key authentication is required, depending on the application master key settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit AES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 192 bit 3K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 64 bit DES key provided key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. No authentication + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_isoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_isoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_isoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_isoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + // 121212 + /** + * @brief Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_aes_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_des_iso_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief From library version 5.0.97, and firmware version 5.0.81. + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreate3k3desApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name pointer to ISO/IEC 7816-4 DF Name array + * @param iso_df_name_len length of the ISO/IEC 7816-4 DF Name array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateDesApplication_no_auth_isoM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create a new application on the card. + * + * If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * Multi reader support + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support + * Function allows to create a new application on the card. If the card master key authentication is required, depending on the card master key settings. Maximal number of applications on the card is 28. Each application is linked to a set of up 14 different user definable access keys. + * ISO/IEC 7816-4 File Identifier, and ISO/IEC 7816-4 DF Name for this application must be defined. + * Application specific Capability data enabled. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param setting application master key settings + * @param max_key_no maximal number of keys into application (1 to 14) + * @param iso_file_id ISO/IEC 7816-4 File Identifier + * @param iso_df_name ISO/IEC 7816-4 DF (Dedicated File) name + * @param iso_df_name_len DF name length + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, uint8_t max_key_no, + uint16_t iso_file_id, IN uint8_t *iso_df_name, uint8_t iso_df_name_len, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplicationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplicationd2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. Provided Key mode (PK) + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit AES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 64 bit DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to deactivate application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Is the authentication with card master key or with the application master key is required, depending on the card master key settings. AID allocation is removed, but deleted memory blocks can only recovered by using Format card function. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfigurationM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. Provided Key mode (PK) + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit AES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 64 bit DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 128 bit 2K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. 192 bit 3K3DES key provided key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetConfiguration_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfigurationDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint8_t random_uid, uint8_t format_disable, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to activate the Random ID option, and/or Format disable option. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * If these options are activated, then they can not be returned to the factory setting (Random ID disabled, Format card enabled). This operation requires authentication with the card master key. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param random_uid 0 - Random ID disabled, 1 - Random ID enabled + * @param format_disable 0 - Format enabled, 1 - Format disabled + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetConfiguration2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint8_t random_uid, + uint8_t format_disable, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting application key settings + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, VAR uint8_t *setting, + VAR uint8_t *max_key_no, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to get card master key and application master key configuration settings. + * + * Multi reader support. No authentication + * In addition it returns the maximum number of keys which can be stored within the selected application. Is authentication with the master key required, depending on the master key setting. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param max_key_no maximum number of keys within selected application + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetKeySettings_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, + VAR uint8_t *setting, VAR uint8_t *max_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Function allows to set card master key, and application master key configuration settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettingsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. Provided Key mode (PK) + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeKeySettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to set card master key, and application master key configuration settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param setting pointer to settings variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeKeySettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t setting, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr ordinal number of AES key in the reader + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr ordinal number of AES key in the reader + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key_nr ordinal number of authentication DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_desM(UFR_HANDLE hndUFR, uint8_t auth_des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_2k3des_key_nr, uint8_t aid_key_no, uint8_t old_2k3des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key_nr key index of 2K3DES key stored in the reader that will be new 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key_nr key index of 2K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_des2k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_2k3des_key_nr, uint8_t aid_key_no, + uint8_t old_2k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key_nr ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_des3k_key_nr, uint32_t aid, + uint8_t aid_key_no_auth, uint8_t new_3k3des_key_nr, uint8_t aid_key_no, + uint8_t old_3k3des_key_nr, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of the key stored in the reader + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. 128 bit AES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key 16 bytes array that represent AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key 16 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeAesKey_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_aes_key[16], uint8_t aid_key_no, IN uint8_t old_aes_key[16], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, uint8_t aid_key_no_auth, + IN uint8_t new_des_key[8], uint8_t aid_key_no, IN uint8_t old_des_key[8], + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 64 bit DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des_key pointer to 8 bytes array containing the DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key 8 bytes array that represent DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key 8 bytes array that represent current AES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeDesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_des_key[8], uint8_t aid_key_no, + IN uint8_t old_des_key[8], VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des2k_key ordinal number of authentication 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_2k3des_key 16 bytes array that represent 2K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_2k3des_key 16 bytes array that represent current 2K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange2K3DesKey_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des2k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_2k3des_key[16], uint8_t aid_key_no, + IN uint8_t old_2k3des_key[16], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_des3k_key pointer to 32 bytes array containing the 3K3DES key + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_3k3des_key 24 bytes array that represent 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_3k3des_key 24 bytes array that represent current 3K3DES key that will be changed, if this is not key by which is made authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChange3K3DesKey_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_des3k_key, uint32_t aid, + uint8_t aid_key_no_auth, IN uint8_t new_3k3des_key[24], uint8_t aid_key_no, + IN uint8_t old_3k3des_key[24], VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. Provided Key mode (PK) + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key pointer to array contained new AES key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeMasterKey_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t auth_key_type, IN uint8_t *new_key, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any AES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of authentication AES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_aes_key_nr key index of AES key stored in the reader that will be new AES key + * @param aid_key_no key number into application that will be changed + * @param old_aes_key_nr key index of AES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeAesKey_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_aes_key_nr, uint8_t aid_key_no, uint8_t old_aes_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 3K3DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des3k_key_nr key index of 3K3DES key stored in the reader that will be new 3K3DES key + * @param aid_key_no key number into application that will be changed + * @param old_des3k_key_nr key index of 3K3DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange3k3desKey_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des3k_key_nr, uint8_t aid_key_no, uint8_t old_des3k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any 2K3DES key on the card. + * + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change any DES key on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeDesKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief *only uFR CS with SAM support + * 128 bit 2K3DES key + * Function allows you to change any AES key on the card. Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that uses this key (3 bytes long, 0x000000 for card master key) + * @param aid_key_no_auth key number into application which uses for authentication + * @param new_des2k_key_nr key index of DES key stored in the reader that will be new DES key + * @param aid_key_no key number into application that will be changed + * @param old_des2k_key_nr key index of DES key stored in the reader that will be used for authentication + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChange2k3desKey_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_no_auth, + uint8_t new_des2k_key_nr, uint8_t aid_key_no, uint8_t old_des2k_key_nr, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows you to change master key of the card from any type to any type. + * + * Multi reader support. *only uFR CS with SAM support + * Changing the card master key requires current card master key authentication. Authentication for the application keys changing depends on the application master key settings (which key is used for authentication). + * Important: When changing a card key to a 2K3DES key, the new 2K3DES key must have different first 8 bytes and second 8 bytes. For example, the new 2K3DES key should be: 11111111111111112222222222222222. New 2K3DES key must not consist of all zeros (16 0x00 bytes). + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param auth_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param new_key_nr key index of a key stored in the reader that will be new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t auth_key_type, uint8_t new_key_nr, + uint8_t new_key_type, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief + * Function writes AES key (16 bytes) into reader. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key in the reader (0 - 15) + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteAesKeyM(UFR_HANDLE hndUFR, uint8_t aes_key_no, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Function writes AES key (16 bytes) into reader. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param key_no ordinal number of key in the reader (0 - 15) + * @param key pointer to array containing the key + * @param key_type enumerated key type (0 - 3) + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteKeyM(UFR_HANDLE hndUFR, uint8_t key_no, IN uint8_t *key, uint8_t key_type); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStddDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from Standard Data File, or from Backup Data File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteStdDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to Standard Data File, or to Backup Data File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteStdDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. Provided Key mode (PK) + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit AES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 64 bit DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @param hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to the Backup Data File. + * + * Multi reader support. No authentication + * From library version 5.0.96, and firmware version 5.0.79. + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteBackupDataFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + int32_t lower_limit, int32_t upper_limit, int32_t value, + uint8_t limited_credit_enabled, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for the storage and manipulation of 32 bit signed integer values within existing application on the card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depending on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param lower_limit lower limit which is valid for this file + * @param upper_limit upper limit which is valid for this file + * @param value initial value of the value file + * @param limited_credit_enabled bit 0 - limited credit enabled (1 - yes, 0 - no) bit 1 - free get value (1 - yes, 0 - no) + * @param read_key_no key for get and debit value + * @param write_key_no key for get, debit and limited credit value + * @param read_write_key_no for get, debit, limited credit and credit value + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, int32_t lower_limit, + int32_t upper_limit, int32_t value, uint8_t limited_credit_enabled, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, VAR int32_t *value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allow to read value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value pointer to value + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, VAR int32_t *value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to increase a value stored in a value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only. + * Credit command requires a preceding authentication with the key specified for Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFileM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t aid_key_nr, uint8_t file_id, uint8_t communication_settings, + uint32_t value, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 128 bit 2K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to decrease value from value files. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * Debit command requires a preceding authentication with on of the keys specified for Read, Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param communication_settings variable that contains communication settings + * @param value value (must be a positive number) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint8_t communication_settings, uint32_t value, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + VAR uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIdsM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIdsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetApplicationIds2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. Provided Key mode (PK) + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 128 bit AES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param application_ids pointer to 8 bytes array containing the DES key + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 64 bit DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_2k3aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. 192 bit 3K3DES key provided key + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function returns the Application Identifiers for all active applications on a card. + * + * Multi reader support. No authentication + * For uFR PLUS devices only + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param application_ids array of application identifiers + * @param number_of_aplication_ids number of application identifiers + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetApplicationIds_no_auth_M(UFR_HANDLE hndUFR, OUT uint32_t *application_ids, + VAR uint8_t *number_of_aplication_ids, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file is filled completely with data records, further writing to file is not possible unless it is cleared. + * Maximal number of files into the application is 32. The file will be created in the currently selected application. If the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If the value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateLinearRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit AES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 64 bit DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, + uint32_t record_size, uint32_t max_rec_no, uint8_t read_key_no, + uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, + uint8_t file_id, uint32_t record_size, uint32_t max_rec_no, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, + uint8_t change_key_no, uint8_t communication_settings, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to create file for multiple storage of structural data, within an existing application. + * + * Multi reader support. No authentication + * Once the file filled completely with data records, the card automatically overwrites the oldest record with latest written one. + * Maximal number of files into application is 32. The file will be created in the currently selected application. Is the application master key authentication is required, depend on the application master key settings. + * Communication settings define communication mode between reader and card. The communication modes are: + * - plain communication communication settings value is 0x00 + * - plain communication secured by MACing communication settings value is 0x01 + * - fully enciphered communication communication settings value is 0x03 + * Access rights for read, write, read&write and changing, references certain key within application's keys (0 - 13). If value is 14, this means free access, independent of previous authentication. If value is 15, this means deny access (for example if write access is 15 then the file type is read only). + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param record_size size of record in bytes + * @param max_rec_no maximal number of records in file + * @param read_key_no key for reading + * @param write_key_no key for writing + * @param read_write_key_no key for reading and writing + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateCyclicRecordFile_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, uint32_t record_size, + uint32_t max_rec_no, uint8_t read_key_no, uint8_t write_key_no, + uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t communication_settings, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, uint8_t communication_settings, uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecordDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, uint8_t communication_settings, + IN uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t data_length, uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows writing data to a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Write command requires a preceding authentication either with the key specified for Write or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation is supported for Desfire Light and Desfire EV2. To use these features, a Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param data_length number of bytes into array number of data to be read + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireWriteRecord_TransMac_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t data_length, + uint8_t communication_settings, IN uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, + uint8_t file_id, uint16_t offset, uint16_t number_of_records, uint16_t record_size, + uint8_t communication_settings, OUT uint8_t *data, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, uint16_t offset, + uint16_t number_of_records, uint16_t record_size, uint8_t communication_settings, + uint8_t *data, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecordsDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireReadRecords2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit AES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 64 bit DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + OUT uint8_t *data, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows to read data from a record in a Linear Record File or Cyclic Record File. + * + * Multi reader support. No authentication + * Read command requires a preceding authentication either with the key specified for Read or Read&Write access. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param offset start position for read operation within file + * @param number_of_records number of records to be read + * @param record_size size of record in bytes + * @param communication_settings variable that contains communication settings + * @param data pointer to data array + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireReadRecords_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + uint16_t offset, + uint16_t number_of_records, + uint16_t record_size, + uint8_t communication_settings, + uint8_t *data, + uint16_t *card_status, + uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_no_authM(UFR_HANDLE hndUFR, + uint32_t aid, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileAesAuth_2M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFileDesAuth_2M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile2k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile3k3desAuth_2M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. Provided Key mode (PK) + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_aes_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_2k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_3k3des_PK_2M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t aid_key_nr, + uint8_t file_id, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aesM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_desM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3desM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3desM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit AES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 64 bit DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 128 bit 2K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. 192 bit 3K3DES key provided key + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t aid_key_nr, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function allows to reset a Linear Record File or Cyclic Record file to the empty state. + * + * Multi reader support. No authentication + * Clear command requires a preceding authentication with the key specified for Read&Write access. + * Bug fix from library version 5.0.29. The aid key number was omitted in function parameters, so it was used application master key number 0 for Read&Write access. For compatibility reasons old functions were retained. New function names have the “_2” suffix. + * From library version 5.0.29 and firmware version 5.0.32, Desfire Light supported. + * NOTE: Transaction MAC file exist by factory default setting. For using this function, user must delete transaction MAC file first. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. Function returns current Reader ID if they used, Previous Encrypted Reader ID, Transaction MAC counter, and Transaction MAC. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * @param use_reader_id 0 - Reader ID is not used, 1- Reader ID is used + * @param reader_id pointer to 16 bytes array containing the Reader ID + * @param prev_enc_reader_id pointer to 16 bytes array containing the Previous Encrypted Reader ID + * @param trans_mac_cnt pointer to value of Transaction MAC counter + * @param trans_mac_value pointer to 8 bytes array containing Transaction MAC + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireClearRecordFile_TransMac_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint16_t *card_status, VAR uint16_t *exec_time, + uint8_t use_reader_id, OUT uint8_t *reader_id, OUT uint8_t *prev_enc_reader_id, + OUT uint32_t *trans_mac_cnt, OUT uint8_t *trans_mac_value); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_M(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_M(UFR_HANDLE hndUFR, + uint8_t des_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_M(UFR_HANDLE hndUFR, + uint8_t des2k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_M(UFR_HANDLE hndUFR, + uint8_t des3k_key_nr, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_aes_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *aes_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multireader support. 128 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_2k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des2k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireCreateTransMacFile_3k3des_PK_M(UFR_HANDLE hndUFR, + IN uint8_t *des3k_key_ext, + uint32_t aid, + uint8_t file_id, + uint8_t read_key_no, + uint8_t commit_reader_id_key_no, + uint8_t change_key_no, + uint8_t communication_settings, + IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, + VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileAesAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFileDesAuthM(UFR_HANDLE hndUFR, + uint8_t des_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no ey for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile2k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function creates Transaction MAC file in application. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param read_key_no key for reading + * @param commit_reader_id_key_no key for commit Reader ID command + * @param change_key_no key for changing this setting + * @param communication_settings variable that contains communication settings + * @param trans_mac_key pointer to 16 bytes array containing Transaction MAC key + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireCreateTransMacFile3k3desAuthM(UFR_HANDLE hndUFR, + uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, + uint8_t read_key_no, uint8_t commit_reader_id_key_no, uint8_t change_key_no, + uint8_t communication_settings, IN uint8_t *trans_mac_key, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_no_auth_M(UFR_HANDLE hndUFR, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetStdFileSize_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSizeDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function retrieves the information about the size of the standard data file stored on the tag. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_size pointer to file size variable + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetStdFileSize2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, uint32_t aid, uint8_t file_id, VAR uint32_t *file_size, uint16_t *card_status, uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key provided key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. No authentication + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_no_auth_M(UFR_HANDLE hndUFR, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_des_M(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_2k3des_M(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettings_3k3des_M(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit AES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 64 bit DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. *only uFR CS with SAM support + * 192 bit 3K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param lower_limit value file lower limit + * @param upper_limit value file upper limit + * @param limited_credit_value value file limited credit value + * @param limited_credit_enable value file limited credit enable (0 - disabled, 1 - enabled) + * @param record_size record file size of record + * @param max_number_of_rec record file maximal number of record + * @param curr_number_of_rec record file number of used record + * @param tm_key_type TMC file key type AES + * @param tm_key_version TMC key version + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, + VAR int32_t *lower_limit, VAR int32_t *upper_limit, VAR uint32_t *limited_credit_value, VAR uint8_t *limited_credit_enable, + VAR uint32_t *record_size, VAR uint32_t *max_number_of_rec, VAR uint32_t *curr_number_of_rec, + VAR uint8_t *tm_key_type, VAR uint8_t *tm_key_version, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireGetFileSettingsSdm_aes_M(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function returns file settings. + * + * Multi reader support. + * *only uFR CS with SAM support + * 128 bit 2K3DES key + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_id ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param file_type file type 0 - standard data file, 1 - backup data file, 2 - value file, 3 - linear record file, 4 - cyclic record file, 5 - transaction MAC file + * @param communication_mode communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param file_size standard data file size + * @param sdm_enable Secure Dynamic Messaging enable status + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireGetFileSettingsSdmAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_id, + VAR uint8_t *file_type, VAR uint8_t *communication_mode, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint32_t *file_size, VAR uint8_t *sdm_enable, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_desM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Multi reader support. + * Function allows changing of file settings + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3desM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3desM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_ext pointer to 8 bytes array containing the DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_ext pointer to 16 bytes array containing the 2K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des2k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_ext pointer to 24 bytes array containing the 3K3DES key + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettings_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *des3k_key_ext, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des_key_nr ordinal number of DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsDesAuthM(UFR_HANDLE hndUFR, uint8_t des_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des2k_key_nr ordinal number of 2K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings2k3desAuthM(UFR_HANDLE hndUFR, uint8_t des2k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param des3k_key_nr ordinal number of 3K3DES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file (0 – 31) + * @param comm_settings communication mode 0 - Plain, 1 - MACed, 3 - Enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettings3k3desAuthM(UFR_HANDLE hndUFR, uint8_t des3k_key_nr, + uint32_t aid, uint8_t file_no, uint8_t comm_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireChangeFileSettingsSdm_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function allows changing of file settings + * + * Multi reader support. + * *only uFR CS with SAM support + * Security Dynamic Messaging settings. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param file_no ID of file that will be created (0 - 31) ID of file (0 - 31) + * @param communication_settings communication mode 0 - plain, 1 - maced, 3 - enciphered + * @param read_key_no read key number + * @param write_key_no write key number + * @param read_write_key_no read write key number + * @param change_key_no change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 13, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 13, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 13, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireChangeFileSettingsSdmM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, + uint32_t aid, uint8_t file_no, uint8_t communication_settings, + uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_ext pointer to 16 bytes array containing the AES key + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireSetTransactionTimer_aesM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function set value of application transaction timer. + * + * Multi reader support. + * *only uFR CS with SAM support + * Desfire EV3 only. + * At the current application specific capability data option must be enabled. + * Application must be created by function uFR_int_DesfireCreateAesApplication_aes_iso_ascd. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key in the reader + * @param aid ID of application that contains the file + * @param transaction_timer 0 - disabled, 1 - 1 - 3 seconds, 2 - 10 - 30 seconds, 3 - 100 - 300 seconds + * @param card_status pointer to card error variable + * @param exec_time function's execution time + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_SAM_DesfireSetTransactionTimerAesAuthM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint32_t aid, uint8_t transaction_timer, VAR uint16_t *card_status, VAR uint16_t *exec_time); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). . + * + * Multi reader support. + * From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param lpucECCSignature 56 bytes ECC signature + * @param card_uid 7 bytes length card UID + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireUidReadECCSignatureM(UFR_HANDLE hndUFR, OUT uint8_t *lpucECCSignature, OUT uint8_t *card_uid, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3des_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key provided key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_ext pointer to array containing the key auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aes_PK_M(UFR_HANDLE hndUFR, IN uint8_t *auth_key_ext, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 64 bit DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit 2K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_2k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 192 bit 3K3DES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_3k3desM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + /** + * @brief Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA). + * + * Multi reader support. From library version 5.0.45 and firmware version 5.0.44. For Desfire Light, and Desfire EV2. + * 128 bit AES key + * If the Random ID is activated, then authentication with a valid key is required. + * + * @ingroup Card_Tag_Mifare_Desfire_M + * + * @param hndUFR hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of key in the reader + * @param aid ID of application that contains the file + * @param aid_key_nr key number into application + * @param card_uid 7 bytes length card UID + * @param lpucECCSignature 56 bytes ECC signature + * @param lpucDlogicCardType pointer to variable which will (in case of successfully executed operation) receive DlogicCardType. Returned here for convenience. For DlogicCardType uFR API uses the same constants as with GetDlogicCardType() function (see Appendix: DLogic CardType enumeration). + * + * @return Operation status + */ + UFR_STATUS DL_API uFR_int_DesfireRidReadECCSignature_aesM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint32_t aid, uint8_t aid_key_nr, + OUT uint8_t *card_uid, OUT uint8_t *lpucECCSignature, VAR uint8_t *lpucDlogicCardType); + + //------------------------------------------------------------------------------------------ + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOnM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function prohibits the blinking of the green diode independently of the user's signaling command. LED and sound signaling occurs only on the user command. This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_Signalization_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API GreenLedBlinkingTurnOffM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOnM(UFR_HANDLE hndUFR); + + /** + * @ingroup UNDOCUMENTED + * + * @return Operation status + */ + UFR_STATUS DL_API RgbInternalTurnOffM(UFR_HANDLE hndUFR); + + ///////////////////////////////////////////////////////////////////// + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, uint8_t RFLevelAmp, + uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeADefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBDefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_212DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersISO14443_424DefaultM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeAM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_212M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg RxGain + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersISO14443_424M(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t CWGsNOff, uint8_t ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API SetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, uint8_t ThresholdMinLevel, uint8_t ThresholdCollLevel, + uint8_t RFLevelAmp, uint8_t RxGain, uint8_t RFLevel, uint8_t CWGsNOn, uint8_t ModGsNOn, + uint8_t CWGsP, uint8_t ModGsP); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param CWGsNOff value in range 0 - 15, part of GsNOffReg + * @param ModGsNOff value in range 0 - 15, part of GsNOffReg + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeATransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *CWGsNOff, VAR uint8_t *ModGsNOff); + + /** + * @brief Multi reader support. The function allows the blinking of the green diode independently of the user's signaling command (default setting). This setting writes into the reader's EEPROM, and it loads when the reader starts up. + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_RFAnalogRegisterSettings_M + * + * @param hndUFR handle of the uFR device + * @param ThresholdMinLevel value in range 0 - 15, part of RxThresholdReg + * @param ThresholdCollLevel value in range 0 - 7, part of RxThresholdReg + * @param RFLevelAmp 0 or 1, part of RFCfgReg + * @param RxGain value in range 0 - 7, part of RFCfgReg + * @param RFLevel value in range 0 - 15, part of RFCfgReg + * @param CWGsNOn value in range 0 - 15, part of GsNOnReg + * @param ModGsNOn value in range 0 - 15, part of GsNOnReg + * @param CWGsP value of CWGsPReg (0 - 47) + * @param ModGsP value of ModGsPReg (0 - 47) + * + * @return Operation status + */ + UFR_STATUS DL_API GetRfAnalogRegistersTypeBTransM(UFR_HANDLE hndUFR, VAR uint8_t *ThresholdMinLevel, VAR uint8_t *ThresholdCollLevel, + VAR uint8_t *RFLevelAmp, VAR uint8_t *RxGain, VAR uint8_t *RFLevel, VAR uint8_t *CWGsNOn, + VAR uint8_t *ModGsNOn, VAR uint8_t *CWGsP, VAR uint8_t *ModGsP); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API FastFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API DefaultBaudrateFlashCheckM(UFR_HANDLE hndUFR); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersM(UFR_HANDLE hndUFR, uint8_t *mui, uint8_t *serial_nr, uint8_t *hw_type, uint8_t *hw_ver, + uint8_t *device_type, uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersDefaultBaudrateM(UFR_HANDLE hndUFR, OUT uint8_t *mui, OUT uint8_t *serial_nr, VAR uint8_t *hw_type, VAR uint8_t *hw_ver, + VAR uint8_t *device_type, VAR uint8_t *fw_ver_major, VAR uint8_t *fw_ver_minor, + VAR uint8_t *fw_ver_build); + + /** + * @ingroup INTERNAL + * EXCLUDE FROM DOCUMENTATION + */ + UFR_STATUS DL_API GetReaderParametersPN7462_M(UFR_HANDLE hndUFR, uint8_t *die_id, uint8_t *serial_nr, + + uint8_t *hw_type, uint8_t *hw_ver, uint8_t *device_type, + uint8_t *fw_ver_major, uint8_t *fw_ver_minor, uint8_t *fw_ver_build); + + // SAM + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing version data + * @param length pointer to length variable + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_version_rawM(UFR_HANDLE hndUFR, OUT uint8_t *data, VAR uint8_t *length); + + /** + * @brief Multi reader support. Function returns manufacturing related data of the MIFARE SAM. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param sam_type pointer to SAM type variable + * @param sam_uid pointer to array containing 7 bytes UID + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_versionM(UFR_HANDLE hndUFR, VAR SAM_HW_TYPE *sam_type, VAR uint8_t *sam_uid); + + /** + * @brief Multi reader support. Function allows reading the contents of the key entry specified in the parameter key_no. For more information refer to NXP documentation. + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_entry pointer to array containing key entry data + * @param key_length pointer to key entry length variable + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_get_key_entry_rawM(UFR_HANDLE hndUFR, uint8_t key_no, OUT uint8_t *key_entry, VAR uint8_t *key_length, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_v ADD DESCRIPTION + * @param des_key ADD DESCRIPTION + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_no_div_desM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_v, IN uint8_t *des_key); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_pesonalization_master_AES128_keyM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ver_a, uint8_t ver_a, + IN uint8_t *aes_key_ver_b, uint8_t ver_b, IN uint8_t *aes_key_ver_c, + uint8_t ver_c, OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param master_aes_key ADD DESCRIPTION + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_pre_personalization_switch_to_AV2_modeM(UFR_HANDLE hndUFR, IN uint8_t *master_aes_key, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function is used to run a mutual 3-pass authentication between the MIFARE SAM AV2 and PC. A host authentication is required to: + * • Load or update keys into the MIFARE SAM AV2 + * • Activate the MIFARE SAM AV2 after reset (if configured accordingly in the configuration settings of master key key_no 00h) + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param host_aes_key pointer to array containing 16 bytes AES key + * @param key_nr key reference number (0 - 127) + * @param key_version key version (0 - 255) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_authenticate_host_AV2_plainM(UFR_HANDLE hndUFR, IN uint8_t *host_aes_key, uint8_t key_nr, uint8_t key_version, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing two Crypto 1 keys (KeyA and KeyB) for authentication to Mifare Classic or Mifare Plus card in SL1 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param keyA pointer to array containing 6 bytes Crypto 1 key A + * @param keyB pointer to array containing 6 bytes Crypto 1 key B + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_mifare_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *keyA, + IN uint8_t *keyB, uint8_t key_no_CEK, uint8_t key_v_CEK, + uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing AES key for authentication to Mifare Desfire or Mifare Plus card in SL3 mode. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 16 bytes of AES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_AES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST containing 3K3DES key for authentication to Mifare Desfire card. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (1 - 127) + * @param key pointer to array containing 24 bytes of 3K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_3K3DES_AV2_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_ULC_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param key pointer to array containing 24 bytes of 2K3DES key + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_2K3DES_AV2_desfire_plain_one_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *key, + uint8_t key_no_CEK, uint8_t key_v_CEK, uint8_t ref_no_KUC, + OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. Function allows changing KST (Key Storage Table) containing 3 AES-128 keys, and their versions. + * The communication in this process is plain, so keys will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_entry_no key reference number (0 - 127) + * @param aes_key_ver_a pointer to array containing 16 bytes of first AES key + * @param ver_a key version of first key (0 - 255) + * @param aes_key_ver_b pointer to array containing 16 bytes of second AES key + * @param ver_b key version of second key (0 - 255) + * @param aes_key_ver_c pointer to array containing 16 bytes of third AES key + * @param ver_c key version of third key (0 - 255) + * @param key_no_CEK reference number of CEK (Change Entry Key). (future host authentication for change this KST must be with AES key with key_no_CEK key reference number) + * @param key_v_CEK version of CEK (future host authentication for change this KST must be with AES key with key_ver_CEK key version) + * @param ref_no_KUC reference number of KUC (Key Usage Counter) (not support jet, unlimited number of authentication ref_no_KUC = 0xFF) + * @param sam_lock_unlock SAM lock/unlock ability. If key_entry_no = 0 (master key), then the SAM will be locked after power up or reset, and minimal set of commands will be available. + * @param sam_auth_host Host authentication ability. If key_entry_no = 0 (master key), then the authentication with host key is mandatory after power up or reset, in opposition minimal set of commands will be available. + * @param apdu_sw pointer to array containing SW1 and SW2 APDU status bytes + * + * @return Operation status + */ + UFR_STATUS DL_API SAM_change_key_entry_aes_AV2_plain_host_keyM(UFR_HANDLE hndUFR, uint8_t key_entry_no, IN uint8_t *aes_key_ver_a, + uint8_t ver_a, IN uint8_t *aes_key_ver_b, uint8_t ver_b, + IN uint8_t *aes_key_ver_c, uint8_t ver_c, uint8_t key_no_CEK, + uint8_t key_v_CEK, uint8_t ref_no_KUC, uint8_t sam_lock_unlock, + uint8_t sam_auth_host, OUT uint8_t *apdu_sw); + + /** + * @brief Multi reader support. If master key has enabled lock/unlock parameter, then SAM unlock with key with lock/unlock ability is required. uFR reader tries to unlock SAM with key which stored into reader by this function. If internal reader keys locked, then they must be unlocked first, with function ReaderKeysUnlock. + * The communication in this process is plain, so key will be exposed during function execution. Use this function in security environment (disconnect LAN). + * + * @ingroup ReaderAndLibrary_NXPSAM_M + * + * @param hndUFR handle of the uFR device + * @param key_no key reference number (0 - 127) + * @param key_ver key version (0 - 255) + * @param aes_key pointer to array containing 16 bytes of AES key + * + * @return Operation status + */ + UFR_STATUS DL_API WriteSamUnlockKeyM(UFR_HANDLE hndUFR, uint8_t key_no, uint8_t key_ver, IN uint8_t *aes_key); + + /** + * @brief Function tries to change the UID on the card. + * Multi reader support. + * On some cards (e.g. Magic Classic) changing UID is possible. If theed card is that type of card, then the function returns UFR_OK. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API CheckUidChangeableM(UFR_HANDLE hndUFR); + + /** + * @brief Function reset RF field at the reader. The RF field will be off, and then on after 50ms. + * + * Multi reader support. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfResetM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch on RF field at the reader. + * + * For proper functionality the reader must be in the multi card mode. + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOnM(UFR_HANDLE hndUFR); + + /** + * @brief Function switch off RF field at the reader. + * + * Multi reader support. + * From library version 5.0.48, and firmware version 5.0.51. + * For proper functionality the reader must be in the multi card mode. The RF field can be switched on by functions ReaderRfOn, EnumCards, or DisableAnticolision. + * + * @ingroup Miscellaneous_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API ReaderRfOffM(UFR_HANDLE hndUFR); + + /** + * EXCLUDE FROM DOCUMENTATION + * @ingroup INTERNAL + */ + UFR_STATUS DL_API WriteReaderIdM(UFR_HANDLE hndUFR, uint8_t *reader_id); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to change the data and AES keys from the initial delivery configuration to a customer specific value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param address Number of block or key + * @param data Value of data or AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_WritePersoM(UFR_HANDLE hndUFR, uint16_t address, IN uint8_t *data); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used to finalize the personalization and switch up to security level 1. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_CommitPersoM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. Security level 0 command. + * Function is used for card personalization. The minimum number of AES keys is entered into the card. There are card master key, card configuration key, key for switch to security level 2, key for switch to security level 3, security level 1 authentication key, virtual card select key, proximity check key, VC polling ENC and VC poling MAC key. Keys can not be changed at security level 1. + * Other keys that are not personalized will have value 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF) + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param card_master_key pointer to 16 byte array containing the card master key + * @param card_config_key pointer to 16 byte array containing the card configuration key + * @param level_2_switch_key pointer to 16 byte array containing the key for switch to security level 2 + * @param level_3_switch_key pointer to 16 byte array containing the key for switch to security level 3 + * @param level_1_auth_key pointer to 16 byte array containing the key for optional authentication at security level 1 + * @param select_vc_key pointer to 16 byte array containing the key for virtual card selection + * @param prox_chk_key pointer to 16 byte array containing the key for proximity check + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling + * @param vc_poll_mac_key pointer to 16 byte array containing the MAC key for virtual card polling + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_PersonalizationMinimalM(UFR_HANDLE hndUFR, IN uint8_t *card_master_key, IN uint8_t *card_config_key, + IN uint8_t *level_2_switch_key, IN uint8_t *level_3_switch_key, IN uint8_t *level_1_auth_key, + IN uint8_t *select_vc_key, IN uint8_t *prox_chk_key, IN uint8_t *vc_poll_enc_key, + IN uint8_t *vc_poll_mac_key); + + /** + * @brief Multi reader support. Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 or 2 command. + * Function is used to switch to security level 3. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_SwitchToSecurityLevel3_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of AES key stored into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1M(UFR_HANDLE hndUFR, uint8_t key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 1 command. + * Security level 1 offers the same functionality as a MIFARE Classic card. + * Function is used to optional AES authentication. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param aes_key pointer to 16 byte array containing the AES key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_AesAuthSecurityLevel1_PKM(UFR_HANDLE hndUFR, IN uint8_t *aes_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card master key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current master key + * @param new_key pointer to 16 byte array containing the new master key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeMasterKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeyM(UFR_HANDLE hndUFR, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index ordinary number of current configuration key stored into reader (0 - 15) or in SAM (1 - 127) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKeySamKeyM(UFR_HANDLE hndUFR, uint8_t key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES card configuration key value. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param old_key pointer to 16 byte array containing the current configuration key + * @param new_key pointer to 16 byte array containing the new configuration key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeConfigurationKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of configuration key stored into reader (0 - 15) + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSetSamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t rid_use, + uint8_t prox_check_use); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used for definition of using Random ID and Proximity check options. Authentication with AES card configuration key required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing the configuration key + * @param rid_use 1 - Randnom ID enabled, 0 - Random ID disabled + * @param prox_check_use 1- Proximity check is mandatory, 0 - Proximity check is not mandatory + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_FieldConfigurationSet_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, uint8_t rid_use, uint8_t prox_check_use); + + /** + * @brief Multi reader support. Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ordinary number of current configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * In order to access the block in sector data, AES authentication is needed. Each sector has two AES keys that can be used for authentication (Key A and Key B). + * Default value if key is not personalized is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF (16 x 0xFF). + * For linear read part of card, enter the same value of sector keys for all sectors which will be read at once. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card. + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKey_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param key_index ordinary number of current sector key stored into reader (0 - 15) + * @param new_key_index ADordinary number of current sector key stored into reader that wile become new key + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeySamExtKeyM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, uint8_t key_index, + uint8_t new_key_index, uint8_t new_key_type); + + /** + * + * @ingroup Card_Tag_Mifare_Plus_M + * @ingroup UNDOCUMENTED + * + * @param hndUFR handle of the uFR device + * @param sector_nr ordinary number of sector (0 - 31) for 2K card, or (0 - 39) for 4K card + * @param auth_mode MIFARE_AUTHENT1A for Key A or MIFARE_AUTHENT1B for Kye B + * @param old_key pointer to 16 byte array containing the current sector key (A or B) + * @param new_key pointer to 16 byte array containing the new sector key (A or B) + * @param new_key_type AES_KEY_TYPE = 0, //AES 16 bytes DES3K_KEY_TYPE = 1, //3K3DES 24 bytes DES_KEY_TYPE = 2, //DES 8 bytes DES2K_KEY_TYPE = 3 //2K3DES 16 bytes + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeSectorKeyExt_PKM(UFR_HANDLE hndUFR, uint8_t sector_nr, uint8_t auth_mode, IN uint8_t *old_key, IN uint8_t *new_key, + uint8_t new_key_type); + + /** + * @brief Multi reader support. Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param key_index_vc_poll_enc_key pointer to 16 byte array containing VC polling ENC key + * @param key_index_vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUidSamKeyM(UFR_HANDLE hndUFR, uint8_t key_index_vc_poll_enc_key, uint8_t key_index_vc_poll_mac_key, + OUT uint8_t *uid, VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * Function is used to read UID if Random ID is enabled. Authentication with AES VC Polling ENC Key and VC Polling MAC Key is mandatory. + * + * @param hndUFR handle of the uFR device + * @param vc_poll_enc_key pointer to 16 byte array containing the ENC key for virtual card polling pointer to 16 byte array containing VC polling ENC key + * @param vc_poll_mac_key pointer to 16 byte array containing VC polling MAC key + * @param uid pointer to byte array containing the card UID + * @param uid_len pointer to UID length variable + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_GetUid_PKM(UFR_HANDLE hndUFR, IN uint8_t *vc_poll_enc_key, IN uint8_t *vc_poll_mac_key, OUT uint8_t *uid, + VAR uint8_t *uid_len); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling ENC key value. Authentication with AES card configuration key is required. + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling ENC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingEncKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + /** + * @brief Multi reader support. Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, IN uint8_t *new_key); + + /** + * @brief Multi reader support. *only uFR CS with SAM support + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key_index ordinary number of card configuration key stored into reader (0 - 15) + * @param new_key_index ordinary number of card configuration key stored into reader that will become new key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKeySamKeyM(UFR_HANDLE hndUFR, uint8_t configuration_key_index, uint8_t new_key_index); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Security level 3 command. + * The function is used to change the AES VC polling MAC key value. Authentication with AES card configuration key is required. + * + * @ingroup Card_Tag_Mifare_Plus_M + * + * @param hndUFR handle of the uFR device + * @param configuration_key pointer to 16 byte array containing card configuration key + * @param new_key pointer to 16 byte array containing new VC Polling MAC key + * + * @return Operation status + */ + UFR_STATUS DL_API MFP_ChangeVcPollingMacKey_PKM(UFR_HANDLE hndUFR, IN uint8_t *configuration_key, IN uint8_t *new_key); + + // ULTRALIGHT C + /** + * @brief Multi reader support. Provided Key mode (PK) + * The 3DES authentication is executed using the transceive mode of reader. Pointer to array which contains 2K 3DES key (16 bytes ) is parameter of this functions. Function don’t use the key which stored into reader. DES algorithm for authentication executes in host device, not in reader. + * After authentication, the reader leaves the transceive mode, but stay in mode where the HALT command doesn’t sending to the card. In this mode user can use functions for block and linear reading or writing. Reader stay into this mode, until the error during reading data from card, or writing data into card occurs, or until the user calls function card_halt_enable(). + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param key pointer to data array of 16 bytes which contains 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_ExternalAuth_PKM(UFR_HANDLE hndUFR, IN uint8_t *key); + + /** + * @brief Multi reader support. No authentication + * This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_no_authM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_key_factory_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key); + + /** + * @brief Multi reader support. This function puts the reader in an “anti-collision” mode of operation. + * + * @ingroup Card_Tag_Ultralight_C_M + * + * @param hndUFR handle of the uFR device + * @param new_3des_key pointer to array of 16 bytes which contains new 2K 3DES key + * @param old_3des_key pointer to array of 16 bytes which contains current 2K 3DES key + * + * @return Operation status + */ + UFR_STATUS DL_API ULC_write_3des_keyM(UFR_HANDLE hndUFR, IN uint8_t *new_3des_key, IN uint8_t *old_3des_key); + + // ESP32 + /** + * @brief Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. + * + * Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayData(IN uint8_t *display_data, IN uint8_t data_length, uint16_t duration); + + /** + * @brief Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderReset(void); + + /** + * @brief It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPassword(IN uint8_t *old_password, IN uint8_t *new_password); + + /** + * @brief Function writes array of data into EEPROM of uFR Online. + * + * Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWrite(IN uint8_t *data, uint32_t address, uint32_t size, IN uint8_t *password); + + /** + * @brief Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromRead(OUT uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param time pointer to the array containing current date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTime(OUT uint8_t *time); + + /** + * @brief Function sets the date and time into uFR Online RTC. + * + * Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTime(IN uint8_t *password, IN uint8_t *time); + + /** + * @brief Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOState(uint8_t pin, uint8_t state); + + /** + * @brief Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOState(OUT uint8_t *state); + + /** + * @brief Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReader(uint8_t reader); + + /** + * @brief Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param SerialNumber pointer to SerialNumber variable. “SerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumber(VAR uint32_t *SerialNumber); + + /** + * @brief Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersion(OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOff(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifi(void); + + /** + * @brief This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableWifi(void); + + // NDEF MESSAGES + //---------------------------------------------------------- + + enum NDEF_STORAGE_MODE + { + STORE_INTO_READER = 0, + STORE_INTO_CARD + }; + + enum NDEF_SKYPE_ACTION + { + CALL = 0, + CHAT + }; + + // WiFi NDEF authentication type + enum WIFI_AUTH_TYPE + { + OPEN = 0, + WPA_PERSONAL, + WPA_ENTERPRISE, + WPA2_ENTERPRISE, + WPA2_PERSONAL + }; + + // WiFi NDEF encryption type + enum WIFI_ENC_TYPE + { + NONE = 0, + WEP, + TKIP, + AES, + AES_TKIP + }; + + /** + * @brief + * Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFi(uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, uint8_t encryption_type, + IN const char *password); + + /** + * @brief Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters)(e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BT(uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMS(uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Bitcoin(uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocation(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestination(uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Email(uint8_t ndef_storage, IN const char *email_address, IN const char *subject, IN const char *message); + + /** + * @brief Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Address(uint8_t ndef_storage, IN const char *address); + + /** + * @brief Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidApp(uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Store text as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Text(uint8_t ndef_storage, IN const char *text); + + /** + * @brief Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetView(uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Skype(uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Whatsapp(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Viber(uint8_t ndef_storage, IN const char *message); + + /** + * @brief Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Contact(uint8_t ndef_storage, IN const char *name, IN const char *company, IN const char *address, + IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF + * + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_Phone(uint8_t ndef_storage, IN const char *phone_number); + + /** + * @brief Multi reader support. Store WiFi configuration as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param ssid Pointer to the null-terminated string that should contain SSID name we want to connect to + * @param auth_type Authentication type: 0 - OPEN 1 - WPA Personal 2 - WPA Enterprise 3 - WPA2 Enterprise 4 - WPA2 Personal + * @param encryption_type Encryption type: 0 - NONE 1 - WEP 2 - TKIP 3 - AES 4 - AES/TKIP + * @param password Pointer to the null-terminated string that should contain password of the SSID we want to connect to + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WiFiM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *ssid, uint8_t auth_type, + uint8_t encryption_type, IN const char *password); + + /** + * @brief Multi reader support. Store BT MAC address for pairing as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bt_mac_address Pointer to the null-terminated string that should contain BT MAC address for pairing in hex format (12 characters) (e.g.: “AABBCCDDEEFF”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BTM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bt_mac_address); + + /** + * @brief Multi reader support. Store phone number and message data as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to the null-terminated string that should contain message data + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SMSM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number, IN const char *message); + + /** + * @brief Multi reader support. Store bitcoin address, amount and donation message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param bitcoin_address Pointer to the null-terminated string that should contain bitcoin address + * @param amount Pointer to the null-terminated string that should contain amount (e.g.: “1.0”) + * @param message Pointer to the null-terminated string that should contain donation message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_BitcoinM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *bitcoin_address, IN const char *amount, + IN const char *message); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store wanted destination as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param destination Pointer to the null-terminated string that should contain city, street name or some other destination + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *destination); + + /** + * @brief Multi reader support. Store email message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param email_address Pointer to the null-terminated string that should contain recipient email address + * @param subject Pointer to the null-terminated string that should contain subject + * @param message Pointer to the null-terminated string that should contain message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_EmailM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *email_address, IN const char *subject, + IN const char *message); + + /** + * @brief Multi reader support. Store address (city, street name, etc) as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param address Pointer to the null-terminated string that should contain city name, street name, etc. + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AddressM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *address); + + /** + * @brief Multi reader support. Store android app package name as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param package_name Pointer to the null-terminated string that should contain android app packagne name + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *package_name); + + /** + * @brief Multi reader support. Store text as NDEF message into reader or into card. + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param text Pointer to the null-terminated string that should contain text + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_TextM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *text); + + /** + * @brief Multi reader support. Store latitude and longitude as NDEF message into reader or into card for Google StreetView. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param latitude Pointer to the null-terminated string that should contain latitude (e.g.: “44.6229337”) + * @param longitude Pointer to the null-terminated string that should contain longitude (e.g.: “21.1787368”) + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_StreetViewM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *latitude, IN const char *longitude); + + /** + * @brief Multi reader support. Store skype username as NDEF message into reader or into card for call or chat. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Action type: call - 0 chat - 1 + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_SkypeM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *user_name, uint8_t action); + + /** + * @brief Multi reader support. Store Whatsapp message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_WhatsappM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store Viber message as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param message Pointer to the null-terminated string that should contain Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ViberM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *message); + + /** + * @brief Multi reader support. Store phone contact as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param name pointer to the null-terminated string that should contain contact display name + * @param company pointer to the null-terminated string that should contain contact company name + * @param address Pointer to the null-terminated string that should contain contact residental address + * @param phone pointer to the null-terminated string that should contain contact phone number + * @param email pointer to the null-terminated string that should contain contact email address + * @param website pointer to the null-terminated string that should contain contact website + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_ContactM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *name, IN const char *company, + IN const char *address, IN const char *phone, IN const char *email, IN const char *website); + + /** + * @brief Multi reader support. Store phone_number as NDEF message into reader or into card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ndef_storage Store NDEF into: reader - 0, card - 1 From library 5.0.31 and firmware 5.0.33 2 - reader RAM + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API WriteNdefRecord_PhoneM(UFR_HANDLE hndUFR, uint8_t ndef_storage, IN const char *phone_number); + //--------------------------------------------------------------------------------------------- + /** + * @brief Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF + * + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFi(OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, OUT char *password); + + /** + * @brief Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Bitcoin(OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocation(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF + * + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestination(OUT char *destination); + + /** + * @brief Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Email(OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF + * + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Address(OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF + * + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidApp(OUT char *package_name); + + /** + * @brief Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF + * + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Text(OUT char *text); + + /** + * @brief Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF + * + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetView(OUT char *latitude, OUT char *longitude); + + /** + * @brief Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF + * + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Skype(OUT char *user_name, OUT char *action); + + /** + * @brief Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Whatsapp(OUT char *message); + + /** + * @brief Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Viber(OUT char *message); + + /** + * @brief Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF + * + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Contact(OUT char *vCard); + + /** + * @brief Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_Phone(OUT char *phone_number); + + /** + * @brief Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF + * + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMS(OUT char *phone_number, OUT char *message); + + /** + * @brief Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF + * + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BT(OUT char *bt_mac_address); + + /** + * @brief Multi reader support. Reads NDEF WiFi configuration from card.. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param ssid Pointer to char array containing SSID name + * @param auth_type Pointer to char array containing authentication type + * @param encryption_type Pointer to char array containing encryption type + * @param password Pointer to char array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WiFiM(UFR_HANDLE hndUFR, OUT char *ssid, OUT char *auth_type, OUT char *encryption_type, + OUT char *password); + + /** + * @brief Multi reader support. Reads NDEF bitcoin address, amount and donation message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bitcoin_address Pointer to char array containing bitcoin_address + * @param amount Pointer to char array containing bitcoin amount + * @param message Pointer to char array containing donation message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BitcoinM(UFR_HANDLE hndUFR, OUT char *bitcoin_address, OUT char *amount, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_GeoLocationM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF navigation destination from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param destination Pointer to char array containing destination + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_NaviDestinationM(UFR_HANDLE hndUFR, OUT char *destination); + + /** + * @brief Multi reader support. Reads NDEF email address, subject and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param email_address Pointer to char array containing recipient email address + * @param subject Pointer to char array containing subject + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_EmailM(UFR_HANDLE hndUFR, OUT char *email_address, OUT char *subject, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF address (city, street name,etc) from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param address Pointer to char array containing address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AddressM(UFR_HANDLE hndUFR, OUT char *address); + + /** + * @brief Reads android app package name stored as NDEF record + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param package_name Pointer to the null-terminated string that should contain android app package name + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_AndroidAppM(UFR_HANDLE hndUFR, OUT char *package_name); + + /** + * @brief Multi reader support. Reads NDEF text from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param text Pointer to char array containing text + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_TextM(UFR_HANDLE hndUFR, OUT char *text); + + /** + * @brief Multi reader support. Reads NDEF latitude and longitude for Google StreetView from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param latitude Pointer to char array containing latitude + * @param longitude Pointer to char array containing longitude + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_StreetViewM(UFR_HANDLE hndUFR, OUT char *latitude, OUT char *longitude); + + /** + * @brief Multi reader support. Reads NDEF skype username and action from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param user_name pointer to the null-terminated string that should contain skype username + * @param action Pointer to char array containing Skype action (“call” or “chat”) + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SkypeM(UFR_HANDLE hndUFR, OUT char *user_name, OUT char *action); + + /** + * @brief Multi reader support. Reads NDEF Whatsapp message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Whatsapp message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_WhatsappM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Viber message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param message Pointer to char array containing Viber message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ViberM(UFR_HANDLE hndUFR, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF phone contact from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param vCard Pointer to char array containing phone contact data + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_ContactM(UFR_HANDLE hndUFR, OUT char *vCard); + + /** + * @brief Multi reader support. Reads NDEF phone number from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_PhoneM(UFR_HANDLE hndUFR, OUT char *phone_number); + + /** + * @brief Multi reader support. Reads NDEF phone number and message from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param phone_number Pointer to char array containing phone number + * @param message Pointer to char array containing message + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_SMSM(UFR_HANDLE hndUFR, OUT char *phone_number, OUT char *message); + + /** + * @brief Multi reader support. Reads NDEF Bluetooth MAC address for pairing from card. + * + * @ingroup Card_Tag_NDEF_M + * + * @param hndUFR handle of the uFR device + * @param bt_mac_address Pointer to char array containing Bluetooth MAC address + * + * @return Operation status + */ + UFR_STATUS DL_API ReadNdefRecord_BTM(UFR_HANDLE hndUFR, OUT char *bt_mac_address); + + /** + * @brief Used to parse NDEF record into separate parameters + * + * @ingroup Card_Tag_NDEF + * + * @param type_record pointer to the array containing record type + * @param type_len length of the record type + * @param payload pointer to the array containing record payload + * @param payload_len length of the record payload + * + * @return Operation status + */ + c_string DL_API ParseNdefMessage(IN uint8_t *type_record, uint8_t type_len, IN uint8_t *payload, uint32_t payload_len); + + // NT4H + + /** + * @brief Multi reader support. Function sets file number, key number, and communication mode, before the using functions for reading and writing data into cards which are used for NTAG 2xx cards. This makes it possible to use existing functions for the block and linear reading and writing. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param communication_mode 0 - plain, 1 - MACed, 3 - enciphered + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_global_parametersM(UFR_HANDLE hndUFR, uint8_t file_no, uint8_t key_no, uint8_t communication_mode); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. The function changes the access parameters of an existing standard data file. The communication mode can be either plain or enciphered based on current access rights of the file, so current communication mode must be entered. Access rights are similar for Desfire cards. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 and NTAG 424 TT - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 and NTAG 424 TT - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_standard_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no NTAG 413 - 1 or 2 NTAG 424 - 1 to 3 + * @param key_no current change key number NTAG 413 - 0 to 2 NTAG 424 - 0 to 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG 424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC read_crt_limit value of SDM reading counter limit + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit); + + /** + * @brief Multi reader support. Function returns file settings. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2, NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_rid_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext); + + /** + * @brief Multi reader support. Function enables card Random ID. Authentication with application master key (key number 0) required. + * Warning. This operation is ireversibile. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_set_ridM(UFR_HANDLE hndUFR, uint8_t aes_key_no); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uid_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Function returns card UID if Random ID activated. Valid authentication is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no card key no used for authentication + * @param uid pointer to array contained UID + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_uidM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, OUT uint8_t *uid); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_key_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Function changes AES key. Authentication with the application master key is required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param key_no key number 0 - 2 or 0 - 4 + * @param new_key pointer to array contained new AES key + * @param old_key pointer to array contained current AES key + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_change_keyM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t key_no, IN uint8_t *new_key, IN uint8_t *old_key); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no file number of SDM file (2) + * @param key_no key number 0 - 2 or 0 - 4 + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctrM(UFR_HANDLE hndUFR, uint8_t auth_key_no, uint8_t file_no, uint8_t key_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. No authentication + * Function supports retrieving of the current values of SDM reading counter. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no file number of SDM file (2) + * @param sdm_read_ctr pointer to value of SDM reading counter + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_sdm_ctr_no_authM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint32_t *sdm_read_ctr); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function allows change parameters for secure dynamic messaging file, or change file type from standard data file to secure dynamic messaging file. Due to the large number of parameters, the function is separated from the function for creating a standard data file. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param file_no 1 - 3 + * @param key_no current change key number 0 - 4 + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain + * @param read_key_no reading key number (14 free access) + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4, 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data + * @param enc_length length of encrypted part of file data + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status mirroring (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_change_sdm_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no, + uint8_t uid_enable, uint8_t read_ctr_enable, uint8_t read_ctr_limit_enable, uint8_t enc_file_data_enable, + uint8_t meta_data_key_no, uint8_t file_data_read_key_no, uint8_t read_ctr_key_no, + uint32_t uid_offset, uint32_t read_ctr_offset, uint32_t picc_data_offset, uint32_t mac_input_offset, + uint32_t enc_offset, uint32_t enc_length, uint32_t mac_offset, uint32_t read_ctr_limit, + uint8_t tt_status_enable, uint32_t tt_status_offset); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param file_no NTAG 413 - 1 or 2; NTAG 424 - 1 to 3 + * @param file_type 0 - standard data file + * @param communication_mode communication mode, 0 - plain, 1 - MACed, 3 - enciphered + * @param sdm_enable 0 - SDM disabled, 1 - SDM enabled + * @param file_size file size in bytes + * @param read_key_no reading key number + * @param write_key_no writing key number + * @param read_write_key_no reading and writing key number + * @param change_key_no new change key number + * @param uid_enable UID mirroring (0 - disabled, 1 - enabled) + * @param read_ctr_enable SDM reading counter (0 - disabled, 1 - enabled) + * @param read_ctr_limit_enable SDM reading counter limit (0 - disabled, 1 - enabled) + * @param enc_file_data_enable using encrypted part of file data (NTAG 424 only) (0 - disabled, 1 - enabled) + * @param meta_data_key_no key number for PICC data (UID and SDM read ctr) encryption 0 - 4 (NTAG 424 only), 14 no encryption, 15 no PICC data + * @param file_data_read_key_no key number for MAC and encrypted part of file data (NTAG424 only) 0 - 2 or 0 - 4, 15 no MAC + * @param read_ctr_key_no key number for SDM reading counter retrieving 0 - 2 or 0 - 4, 14 free, 15 no access + * @param uid_offset mirror position of UID if PICC data aren’t encrypted + * @param read_ctr_offset mirror position of SDM reading counter if PICC data aren’t encrypted + * @param picc_data_offset mirror position of encrypted PICC data (NTAG 424 only) + * @param mac_input_offset offset in the file where the SDM MAC computation starts + * @param enc_offset mirror position of encrypted part of file data (NTAG 424 only) + * @param enc_length length of encrypted part of file data (NTAG 424 only) + * @param mac_offset mirror position of SDM MAC + * @param read_ctr_limit value of SDM reading counter limit + * @param tt_status_enable tag tamper status (0 - disabled, 1 - enabled) + * @param tt_status_offset mirror position of tag tamper status + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_tt_get_file_settingsM(UFR_HANDLE hndUFR, uint8_t file_no, VAR uint8_t *file_type, VAR uint8_t *communication_mode, VAR uint8_t *sdm_enable, VAR uint32_t *file_size, + VAR uint8_t *read_key_no, VAR uint8_t *write_key_no, VAR uint8_t *read_write_key_no, VAR uint8_t *change_key_no, + VAR uint8_t *uid_enable, VAR uint8_t *read_ctr_enable, VAR uint8_t *read_ctr_limit_enable, VAR uint8_t *enc_file_data_enable, + VAR uint8_t *meta_data_key_no, VAR uint8_t *file_data_read_key_no, VAR uint8_t *read_ctr_key_no, + VAR uint32_t *uid_offset, VAR uint32_t *read_ctr_offset, VAR uint32_t *picc_data_offset, VAR uint32_t *mac_input_offset, + VAR uint32_t *enc_offset, VAR uint32_t *enc_length, VAR uint32_t *mac_offset, VAR uint32_t *read_ctr_limit, + VAR uint8_t *tt_status_enable, VAR uint32_t *tt_status_offset); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key pointer to array contained AES key auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signature_pkM(UFR_HANDLE hndUFR, IN uint8_t *auth_key, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, VAR uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. From library version 5.0.43 and firmware version 5.0.43. + * Function retrieves the asymmetric originality signature based on an asymmetric cryptographic algorithm Elliptic Curve Cryptography Digital Signature Algorithm (ECDSA) when the Random ID is activated. Authentication with valid key required. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param auth_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 + * @param uid 7 bytes UID length + * @param ecc_signature 56 bytes ECC signature + * @param dlogic_card_type card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_rid_read_ecc_signatureM(UFR_HANDLE hndUFR, uint8_t auth_key_nr, uint8_t key_no, OUT uint8_t *uid, + OUT uint8_t *ecc_signature, OUT uint8_t *dlogic_card_type); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_nr ordinal number of AES key into reader (0 - 15) + * @param key_no 0 - 4 *uid 7 bytes UID length *ecc_signature 56 bytes ECC signature *dlogic_card_type + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_statusM(UFR_HANDLE hndUFR, uint8_t aes_key_nr, uint8_t key_no, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. No authentication + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function supports retrieving of the permanent and current Tag Tamper Status. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param tt_perm_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * @param tt_curr_status tag tamper permanent status: I - invalid status, feature not activated; C - tamper seal closed; O - tamper seal opened + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_get_tt_status_no_authM(UFR_HANDLE hndUFR, VAR uint8_t *tt_perm_status, VAR uint8_t *tt_curr_status); + + /** + * @brief Multi reader support. Provided Key mode (PK) + * NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_tt_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. NTAG 424 TT only. From library version 5.0.43 and firmware version 5.0.43. + * Function enabling tag tamper feature. Authentication with application master key (key number 0) required. + * Warning. Enabling the Tag Tamper feature is permanent, it cannot be disabled once enabled. + * + * @ingroup Card_Tag_NT4H_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no ordinal number of AES key into reader (0 - 15) + * @param tt_status_key_no 0 - 4, 14 free access + * + * @return Operation status + */ + UFR_STATUS DL_API nt4h_enable_ttM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t tt_status_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settings_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function changes file settings. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 0, 1, 3, 4, 15 or 31 + * @param key_no current change key no + * @param curr_communication_mode current communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param new_communication_mode new communication mode 0 - plain, 1 - MACed, 3 - enciphered + * @param read_key_no read key number (0 - 4) + * @param write_key_no write key number (0 - 4) + * @param read_write_key_no read write key number (0 - 4) + * @param change_key_no change key number (0 - 4) + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_change_file_settingsM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no, uint8_t key_no, uint8_t curr_communication_mode, + uint8_t new_communication_mode, uint8_t read_key_no, uint8_t write_key_no, uint8_t read_write_key_no, uint8_t change_key_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_ext pointer to array contained AES key aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_file_pkM(UFR_HANDLE hndUFR, IN uint8_t *aes_key_ext, uint8_t file_no); + + /** + * @brief Multi reader support. From library version 5.0.29 and firmware version 5.0.32. Desfire Light specific command. + * Function delete transaction MAC file. + * NOTE: Transaction MAC file exist by factory default. To use the operations with value file, and cyclic record file, this file must be deleted. + * From library version 5.0.37 and firmware version 5.0.38, Transaction MAC operation supported for Desfire Light and Desfire EV2. To use these features, an Transaction MAC file must exist in the selected application. + * + * @ingroup Card_Tag_Mifare_Desfire_Light_M + * + * @param hndUFR handle of the uFR device + * @param aes_key_no reader key number of AES key (0 - 15) + * @param file_no file number 15 + * + * @return Operation status + */ + UFR_STATUS DL_API dfl_delete_tmc_fileM(UFR_HANDLE hndUFR, uint8_t aes_key_no, uint8_t file_no); + + /** + * @brief Multi reader support. Function enables sending data to the uFR Online. A string of data contains information about the intensity of color in each cell of the LED indication. Each cell has three LEDs (red, green and blue). For each cell of the three bytes is necessary. The first byte indicates the intensity of the green color, the second byte indicates the intensity of the red color, and the third byte indicates the intensity of blue color. For example, if the display has 2 cells, an array contains 6 bytes. Value of intensity is in the range from 0 to 255. On uFR Online, there are 2 cells.From firmware version 2.7.6, RGB LEDs can be connected to pin 5 of P5 connector (GPIO connector - ESP pin 18). First 6 bytes in display_data array will be sent to internal RGB LEDs, additional bytes will be sent to external connected RGB. There is no limit for number of external cells. + * Array data example: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF + * First 6 bytes will be sent to internal RGB and additional 3 bytes will be sent to first cell of external RGB. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param display_data pointer to data array + * @param data_length number of bytes into array + * @param duration number of milliseconds to light. if value is 0, then rgb will light infinitely + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetDisplayDataM(UFR_HANDLE hndUFR, uint8_t *display_data, uint8_t data_length, uint16_t duration); + + /** + * @brief Multi reader support. Physical reset of uFR reader communication port. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderResetM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. It defines/changes password which I used for: + * * Writing in EEPROM + * * Setting date/time of RTC + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param old_password pointer to the 8 bytes array containing current password + * @param new_password pointer to the 8 bytes array containing new password + * + * @return Operation status + */ + UFR_STATUS DL_API EspChangeReaderPasswordM(UFR_HANDLE hndUFR, uint8_t *old_password, uint8_t *new_password); + + /** + * @brief Multi reader support. Function writes array of data into EEPROM of uFR Online. Maximal length of the array is 128 bytes. Function requires a password which is 8 bytes. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * @param password pointer to array containing password + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromWriteM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size, uint8_t *password); + + /** + * @brief Multi reader support. Function returns array of data read from EEPROM of uFR Online. Maximal length of the array is 128 bytes. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param data pointer to array containing data from EEPROM + * @param address address of first data + * @param size length of array + * + * @return Operation status + */ + UFR_STATUS DL_API EspReaderEepromReadM(UFR_HANDLE hndUFR, uint8_t *data, uint32_t address, uint32_t size); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represents current date and time into uFR Online RTC. + * * Byte 0 represent year (current year - 2000) + * * Byte 1 represent month (1 - 12) + * * Byte 2 represent day of the month (1 - 31) + * * Byte 3 represent hour (0 - 23) + * * Byte 4 represent minute (0 - 59) + * * Byte 5 represent second (0 - 59) + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *time); + + /** + * @brief Multi reader support. Function sets the date and time into uFR Online RTC. Function requires the 8 bytes password entry to set date and time. Date and time are represented into a 6 bytes array in the same way as in EspGetReaderTime function. Factory password is “11111111” (0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31, 0x31). + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param password pointer to the 8 bytes array containing password + * @param time pointer to the 6 bytes array containing date and time representation + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetReaderTimeM(UFR_HANDLE hndUFR, uint8_t *password, uint8_t *time); + + /** + * @brief Multi reader support. Function sets uFR Online IO pin state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param pin IO pin number (1 - 6) + * @param state IO pin state 0 - low level, 1 - high level, 2 - input + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetIOStateM(UFR_HANDLE hndUFR, uint8_t pin, uint8_t state); + + /** + * @brief Multi reader support. Function returns 6 bytes array of uint8_t that represented IO pins logic level state. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param state pointer to the 6 bytes array containing IO pins states + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetIOStateM(UFR_HANDLE hndUFR, uint8_t *state); + + /** + * @brief Multi reader support. Function sets uFR Online transparent reader. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param reader Transparent reader number + * + * @return Operation status + */ + UFR_STATUS DL_API EspSetTransparentReaderM(UFR_HANDLE hndUFR, uint8_t reader); + + /** + * @brief Multi reader support. Returns uFR Online reader serial number as a pointer to 4 byte value. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands_M + * + * @param hndUFR handle of the uFR device + * @param lpulSerialNumber pointer to lpulSerialNumber variable. “lpulSerialNumber “ as result holds 4 byte serial number value. + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetReaderSerialNumberM(UFR_HANDLE hndUFR, uint32_t *lpulSerialNumber); + + /** + * @brief Multi reader support. Returns uFR Online reader firmware version. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * @param major Major firmware version + * @param minor Minor firmware version + * @param build Build firmware version + * + * @return Operation status + */ + UFR_STATUS DL_API EspGetFirmwareVersionM(UFR_HANDLE hndUFR, OUT uint8_t *major, OUT uint8_t *minor, OUT uint8_t *build); + + /** + * @brief Multi reader support. Turn off uFR Online device. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspTurnOffM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Disable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned off device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspDisableWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Multi reader support. This option is only avaliable in BT/BLE mode. Enable Wifi on uFR Online device when working in BLE/BT mode. This option is saved in flash and Wifi will stay turned on device restart. + * + * @ingroup ReaderAndLibrary_uFROnlineCommands + * + * @param hndUFR handle of the uFR device + * + * @return Operation status + */ + UFR_STATUS DL_API EspEnableOnWifiM(UFR_HANDLE hndUFR); + + /** + * @brief Function sets service data into eeprom. Only use with production firmware. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array of 5 bytes which contains new service data + * @return Operation status + */ + UFR_STATUS DL_API SetServiceDataM(UFR_HANDLE hndUFR, IN uint8_t *data); + + /** + * @brief Function gets service data from eeprom. Use in diagnostic tool. + * @since uFCoder library version 6.0.9 + * + * @ingroup INTERNAL + * @param hndUFR handle of the uFR device + * @param data pointer to array which contains service data + * @return Operation status + */ + UFR_STATUS DL_API GetServiceDataM(UFR_HANDLE hndUFR, OUT uint8_t *data); + + + /** + * @brief Multi reader support. As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General_M + * + * @param hndUFR handle of the uFR device + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + + UFR_STATUS DL_API COMTransceiveM(UFR_HANDLE hndUFR, IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief As of uFCoder library v5.0.71 users can use COM protocol via uFCoder library by calling this method. It handles transmission of CMD and CMD_EXT commands and it handles RSP and RSP_EXT packets that are a response to the COM protocol commands. + * + * @ingroup Card_Tag_General + * + * @param cmd Pointer to array of CMD bytes for transmission. Last byte is the checksum. + * @param cmd_length Length of the CMD array, always set it to 7. + * @param cmd_ext Pointer to array of CMD_EXT bytes for transmission. Last byte is the checksum. + * @param cmd_ext_length If the length is greater than 0, CMD_EXT bytes will be transmitted. Otherwise they will not. This is the size of CMD_EXT array that will be sent to the reader. + * @param rsp Pointer to array of bytes containing RSP bytes. + * @param rsp_length Pointer to a variable holding how many RSP bytes have been received. + * @param rsp_ext Pointer to array of bytes containing RSP bytes. If greater than zero, RSP_EXT exists. + * @param rsp_ext_length Pointer to a variable holding how many RSP_EXT byte have been received. + * + * @return Operation status + */ + UFR_STATUS DL_API COMTransceive(IN uint8_t *cmd, uint32_t cmd_length, IN uint8_t *cmd_ext, uint32_t cmd_ext_length, OUT uint8_t *rsp, VAR uint32_t *rsp_length, OUT uint8_t *rsp_ext, VAR uint32_t *rsp_ext_length); + // DLL version ---------------------------------------------------------------- + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + uint32_t DL_API GetDllVersion(void); + + /* + * Get "exploded" dll version example: + * + * #include + * #include + * + * void main(int argc, char *argv[]) + * { + * uint32_t dwDllVersion = 0; + * uint32_t dwDllMajorVersion = 0; + * uint32_t dwDllMinorVersion = 0; + * uint32_t dwDllBuild = 0; + * + * dwDllVersion = GetDllVersion(); + * + * // "explode" the dll version: + * dwDllMajorVersion = (DWORD)(LOBYTE(LOWORD(dwDllVersion))); + * dwDllMinorVersion = (DWORD)(HIBYTE(LOWORD(dwDllVersion))); + * + * // Get the dll build number. + * dwDllBuild = (DWORD)(HIWORD(dwDllVersion)); + * + * printf("Dll version is %ld.%ld (%ld)\n", dwDllMajorVersion, + * dwDllMinorVersion, + * dwDllBuild); + * } + * + */ + // Originality Check (performs the check is the chip on the card/tag NXP genuine): + /** + * @brief This function depends on OpenSSL crypto library. Since OpenSSL crypto library is dynamically linked during execution, the only prerequisite for a successful call to this function is that the libeay32.dll is in the current folder (valid for Windows) and / or libcrypto.so is in the environment path (e.g. LD_LIBRARY_PATH on Linux / macOS). OriginalityCheck() performs the check if the chip on the card / tag is NXP genuine. + * + * @ingroup Card_Tag_CardFeatures_OriginalityChecking + * + * @param signature ECCSignature acquired by call to the ReadECCSignature() function. + * @param uid Card UID. Best if the card UID is acquired by previous call to the ReadECCSignature() function. + * @param uid_len Card UID length. Best if the card UID length is acquired by previous call to the ReadECCSignature() function. + * @param DlogicCardType Card type. Best if the DlogicCardType is acquired by previous call to the ReadECCSignature() function. + * + * @return Operation status + */ + UFR_STATUS DL_API OriginalityCheck(IN const uint8_t *signature, IN const uint8_t *uid, uint8_t uid_len, uint8_t DlogicCardType); + // Returns: + // UFR_OPEN_SSL_DYNAMIC_LIB_NOT_FOUND in case there is no OpenSSL library (libeay32.dll) in current folder or path + // UFR_OPEN_SSL_DYNAMIC_LIB_FAILED in case of OpenSSL library error (e.g. wrong OpenSSL version) + // UFR_NOT_NXP_GENUINE if chip on the card/tag is NOT NXP genuine + // UFR_OK is chip on the card/tag is NXP GENUINE + + //// debug functions: + /** + * @brief This function returns library version as string. + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @return Operation status + */ + c_string DL_API GetDllVersionStr(void); + + /** + * @brief Returns UFR_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param status UFR_STATUS status variable + * + * @return Operation status + */ + c_string DL_API UFR_Status2String(const UFR_STATUS status); + + /** + * @brief Returns UFR_SESSION_STATUS error code as a c_string + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param session_status UFR_SESSION_STATUS status variable + * + * @return c_string value of the status code + */ + c_string DL_API UFR_SessionStatus2String(const UFR_SESSION_STATUS session_status); + + /** + * @brief Returns card type as a c_string instead of byte value + * + * @ingroup ReaderAndLibrary_HelperFunc + * + * @param dl_type_code card type value based on DLogic CardType enumeration + * + * @return Operation status + */ + c_string DL_API UFR_DLCardType2String(uint8_t dl_type_code); + +//// Helper functions: +#ifndef _WIN32 + + unsigned long GetTickCount(void); + +#endif // #ifndef _WIN32 + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + /** + * @brief This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information + * + * @return The reader's descriptive name + */ + c_string DL_API GetReaderDescription(void); + + /** + * @brief Multi reader support. This function returns the reader's descriptive name. Return type is string. No parameters required. + * + * @ingroup ReaderAndLibrary_Information_M + * + * @param hndUFR handle of the uFR device + * + * @return Returns the reader's descriptive name. + */ + c_string DL_API GetReaderDescriptionM(UFR_HANDLE hndUFR); + + //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + +//#ifdef _WIN32 || __linux__ + +//#else +//#endif // _WIN32 + + + +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +#ifdef __ANDROID__ +#include + + extern JNIEnv *global_env; + extern jclass global_class; + extern jclass usb_global_class; + + /** + + * + * @param env + * @param class1 + * + * @return Operation status + */ + void DL_API initVM(JNIEnv *env, jclass class1); +#endif + +#ifdef __cplusplus +} +#endif + +#ifdef __APPLE__ +#include + #if TARGET_OS_IPHONE + typedef void (*CardDetectedCallback)(void* _Nonnull context,const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(void* _Nonnull context); + typedef void (*SessionErrorCallback)(void* _Nonnull context, UFR_SESSION_STATUS error_code, const char* error_description); + /** + * @brief For iOS only: This function is used to set message displayed when the NFC Session window is started
+ * E.g 'Read the tag with the phone' + * NFC Session can be started via ReaderOpenEx() and appropriate parameters, or openNFCSession() + * @since uFCoder library version 6.0.0 + * + * @ingroup Miscellaneous + * + * @return Operation status + */ + void setNFCMessage(const char *message); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * @param context pointer to UIView that bridges Swift with native code. e.g `let ble_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(void* _Nonnull context, const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + void DL_API closeBLESession(void); + + /** + * @brief For iOS only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param context pointer to UIView that bridges Swift with native code. e.g `let nfc_context = Unmanaged.passUnretained(contentView).toOpaque()` + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(void* _Nonnull context, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + #else + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); + + #endif // TARGET_OS_IPHONE +#endif // __APPLE__ + +#ifdef __ANDROID__ + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks via BLE.
+ * uFR Online reader only. Must be set in 'BLE' mode
+ * The function takes pointers to user-defined functions as 'card_detected_callback', 'card_removed_callback' and 'error_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param reader_sn uFR Online reader serial number (e.g ONXXXXXX) + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param session_error_callback TEST + * + * @return Operation status + */ + UFR_STATUS DL_API openBLESession(const char* reader_sn, int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openBLESession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeBLESession(void); + + /** + * @brief For Android only: This function is used to enable asynchronous event-driven API callbacks for internal NFC.
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param timeout session duration, how long it will keep receiving callbacks (in seconds) + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * @param error_callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * @param license_json JSON string containing full license data for offline use. Use the GetLicenseRequestData() and refer to additional documentation there on how to obtain an offline license. + * + * @return Operation status + */ + UFR_STATUS DL_API openNFCSession(int timeout, CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback, SessionErrorCallback error_callback, const char* license_json); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by openNFCSession() + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + void DL_API closeNFCSession(void); + + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + UFR_STATUS DL_API StopAsyncSession(); +#endif // __ANDROID__ + +#if defined(_WIN32) || defined(__linux__) + typedef void (*CardDetectedCallback)(const char *uid, const char* dl_card_type, const char* manufacturer); + typedef void (*CardRemovedCallback)(); + typedef void (*SessionErrorCallback)(UFR_SESSION_STATUS error_code, const char* error_description); + + /** + * @brief This function is used to enable asynchronous event-driven API callbacks.
+ * Prerequisites: ReaderOpen() or ReaderOpenEx() must be called first and must return `UFR_OK` status to open connection with the reader
+ * The function takes pointers to user-defined functions as 'card_detected_callback' and 'card_removed_callback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param card_detected_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * @param card_removed_callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + UFR_STATUS DL_API StartAsyncSession(CardDetectedCallback card_detected_callback, CardRemovedCallback card_removed_callback); + + /** + * @brief This function is used to stop receiving asynchronous callbacks previously set by StartAsyncSession() + * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @return Operation status + */ + UFR_STATUS DL_API StopAsyncSession(); + +#endif // _WIN32 || __linux__ + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardDetectedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardDetectedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardDetectedCallback(CardDetectedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'CardRemovedCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'CardRemovedCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setCardRemovedCallback(CardRemovedCallback callback); + + /** + * @brief This function is used to set or change the function that wil be called as a 'SessionErrorCallback'
+ * @since uFCoder library version 6.0.3 + * + * @ingroup ReaderAndLibrary_uFRSpecificFeatures_AsynchronousUIDSending + * + * @param callback Pointer to a function that user defines, signature of user-defined method must match the 'SessionErrorCallback' typedef defined in uFCoder.h + * + * @return Operation status + */ + void DL_API setSessionErrorCallback(SessionErrorCallback callback); + + + +#endif /* uFCoder_H_ */ diff --git a/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/libuFCoder-ios_simulator-static.a b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/libuFCoder-ios_simulator-static.a new file mode 100644 index 0000000000000000000000000000000000000000..97796cb16014b036f615a66709de6a5bdada6de6 Binary files /dev/null and b/lib/ios_framework/uFCoder.xcframework/ios-arm64_x86_64-simulator/libuFCoder-ios_simulator-static.a differ diff --git a/lib/ios_simulator/libuFCoder-ios_simulator-static.a b/lib/ios_simulator/libuFCoder-ios_simulator-static.a new file mode 100644 index 0000000000000000000000000000000000000000..97796cb16014b036f615a66709de6a5bdada6de6 Binary files /dev/null and b/lib/ios_simulator/libuFCoder-ios_simulator-static.a differ diff --git a/lib/license/uFR_library_license.md b/lib/license/uFR_library_license.md new file mode 100644 index 0000000000000000000000000000000000000000..158c8a396a6ae7045e196aa61e6af9fd262fc745 --- /dev/null +++ b/lib/license/uFR_library_license.md @@ -0,0 +1,249 @@ +# LICENSE AGREEMENT /EN (the Serbian /SR version follows) + + +FOR µFR SERIES NFC READER’S LIBRARIES + +By: +Digital Logic Ltd. +Nemanjina 57A, Pozarevac, Serbia +Rev. 1.9 +July 2023 + + +## License + +1. Under this **Agreement**, **Digital Logic Ltd** (later in text **“Vendor”**) grants the non-exclusive and non-transferable **License** (later in text **"License"**) to its **users** (later in text **“Licensee”**), for the use of **µFR Series device’s Libraries** (later in text **“Libraries”**). + +2. To use these **Libraries**, Licensee must read and accept this **License Agreement**, and all its contents. Downloading and using **Libraries**, can also be considered as acceptance of this **License Agreement**. + +3. This License gives the **Licensees** the right to use/incorporate these **Libraries** in his own project and distribute it as such - only in accordance with the provisions of this License. + + +## Modifying and distributing the Libraries + +4. **Licensees** are entitled to use **Libraries** to fit their project needs as long as it complies with Paragraph 1 of this **Agreement** and other provisions of this License. + +5. **Licensees** can use/incorporate **Libraries** in his own project, and distribute it as such (sell, rent, give for free, or disclose in other way) as long as it complies with provisions of this **License**. + + +## License Fee and Restrictions + +6. **Licensees** which use these **Libraries** with any µFR Series device made by **Vendor** will be entitled to use them without any charge. + +7. For use with any other hardware (not made by **Vendor**), **Licensees** must contact **Vendor** for fees and terms of use. + +8. **Licensee** is forbidden to sell, publish, rent, disclose, or otherwise provide **Libraries** or any of its parts to any third party, except as expressly permitted in this License. + +9. **Licensee** is forbidden to use **Libraries** and/or its materials in any manner that would cause it to fall under any Open Source License. For example, **Licensee** is forbidden to incorporate the **Libraries** and/or its materials to an own project and then license it in whole under any Open Source or similar license, that way some of the restrictions prescribed by this License would be illegally revoked and **Licensee** would bear all responsibility for such a scenario. + +10. **Licensee** is forbidden to use **Libraries** in any illegal manner or use it to develop or transmit any malicious code, and is also obligated to comply with all national and international laws, rules, and regulations regarding its usage. + +11. **Licensee** is forbidden to make any use of the **Libraries** in any manner not permitted by this **Agreement**. + + +## Special terms of use of the uFCoder library +(use without uFR contactless card reader / programmer) + +Note: If you use the uFCoder library for Android or iOS platform with [µFR Series NFC devices](https://webshop.d-logic.net/products/nfc-rfid-reader-writer/ufr-series-dev-tools-with-sdk.html) from the Digital Logic product range - you do not have to pay any fee and are not subject to the conditions stated from paragraph 12 to 17. + + + +12. If you use the uFCoder library for Android or iOS platform without µFR Series NFC reader/programmer device, the following conditions apply: + +13. A dedicated licensing system has been developed for users who do not use devices from the uFR series of NFC readers. +Each user receives 10 free licenses, i.e. the opportunity to use the library for free on 10 different devices. +App package name and hardware ID generated by the Android or iOS environment is used for tracking the number of licenses used by the app with the same package name. Each user, when creating an application that uses the uFR Library, is obligated to define their own unique package name. + +14. If the User wants to use the library with the number of devices exceeding 10, he will be able to pay for additional licenses according to the following price list: + +Number of licenses - Monthly price per license/device + +1-10 - free +10-100 - 0.85 € without VAT per device +100-500 - 0.80 € ex. VAT per device +500-1000 - 0.75 € ex. VAT per device +1000+ - 0.70 € ex. VAT per device + +15. Invoicing is done at the end of the month for the number of devices (licenses) used by the library. The invoiced amount should be paid no later than 7 days from the date of the invoice. + +16. Upon request, the user can obtain a listing showing the number of accesses to the library by individual devices related to the User's package name. + +17. If the number of devices that use the library under the same package name exceeds 10 and the User does not apply for additional licenses or if he does not settle his outstanding balance on time, we reserve the right to terminate his ability to use the Library. + +18. Additional licensing information is available at: licensing@d-logic.com + +## Copyright and intellectual property + +19. All **Title**, **Copyright**, **Distribution**, **Intellectual** and **Property rights** remain exclusively with **Vendor**. This **Agreement** is only related to licensing of use and does not give **Licensee** any right to appropriate and/or transfer its ownership in any way. + +20. The **Libraries** may incorporate parts of **Code** from other **Vendors** under specific licenses which will always be visible and correctly emphasized in the accompanying documentation. + +21 Upon request, the source code of the library can be provided for the **Licensee**, with the obligatory conclusion of an NDA contract with the **Vendor**. + + +## Terms of Acceptance + +22. All terms, obligations, and conditions of this **Agreement** are deemed to be accepted by obtaining any version of the **Libraries** as subject to this license, either by download from **Vendor’s** website or any other way. + + +## Security + +23. **Licensees** are solely responsible for the application of the **Libraries** in their project, including security issues. This responsibility is related, but not limited to User personal data exposure. + + +## Limitation of Liability + +24. These **Libraries** are provided **"As is"** and **Vendor** makes **NO WARRANTIES**, expressed, implied, statutory or other. **Licensee** is in obligation to control, test and maintain the safety of its usage. + +25. **Vendor** will not be liable for any kind of damages arising from the usage of the **Libraries** and its materials whatsoever. Including, but not limited to: Profit Loss, Data loss, loss of use, Confidential Information exposure, Business Interruption, Personal Injury, Property Damage, or any other form of damage. + + +## Governing Law and Venue + +26. This **Agreement** will be governed by the Laws of the Republic of Serbia with jurisdiction and Venue of Serbian Court concerning any claims, proceedings, and lawsuits regarding this **License Agreement**. + + +## Modifications of the License Agreement + +27. **Vendor** reserves the right to change the contents of this **License Agreement**. All changes will be posted on **Vendor’s** official website included in new **License Agreement** revisions and will take in effect no sooner than 30 days after changes are posted. + + +## Contact information + +Vendor contact: +Digital Logic Ltd. +Nemanjina 57A +12000 Pozarevac +Serbia +Tel: +38112541022 +e-mail: legal@d-logic.com + + + +_________________________________________________________ + + + + +# UGOVOR O LICENCI /SR + + +ZA BIBLIOTEKE NFC ČITAČA SERIJE µFR + +Od strane: +Digital Logic Ltd. +Nemanjina 57A, Požarevac, Srbija +Rev. 1.9 +Jul 2023 + + +## Licenca + +1. Prema ovom **Ugovoru**, **Digital Logic Ltd** (dalje u tekstu **„Prodavac“**) daje neekskluzivnu i neprenosivu **Licencu** (dalje u tekstu **„Licenca“**) svojim **Korisnicima** (dalje u tekstu **„Korisnik licence“**), za korišćenje **Biblioteke** uređaja serije µFR (dalje u tekstu **„Biblioteke“**). + +2. Da bi koristio uFCoder **Biblioteke**, K**orisnik** **Licence** mora pročitati i prihvatiti ovaj **Ugovor** o licenciranju i sav njegov sadržaj. Preuzimanje i korišćenje **Biblioteka** takođe se smatra prihvatanjem ovog **Ugovora** o licenciranju. + +3. Ova **Licenca** daje **Korisniku licence** pravo da koristi/ugradi ove **Biblioteke** u sopstveni projekat i distribuira ih kao takve - isključivo u skladu sa odredbama predmetne **Licence**. + + +## Modifikovanje i distribucija biblioteka + +4. **Korisnici licence** imaju pravo da koriste **Biblioteke** za potrebe svog projekta sve dok je to u skladu sa Stavom 1. ovog **Ugovora** i drugim odredbama ove **Licence**. + +5. **Korisnik licence** može koristiti/ugraditi **Biblioteke** u sopstveni projekat i tako ih distribuira (prodaje, iznajmljuje, poklanja ili na drugi način obelodanjuje) sve dok je to u skladu sa odredbama ove **Licence**. + + +## Naknada za licencu i ograničenja + + +6. **Korisnici licenci** koji koriste ove biblioteke** sa bilo kojim uređajem serije µFR koje je proizveo **Prodavac** imaće pravo da ih koriste bez ikakve naknade. + +7. Uslovi za korišćenje **Biblioteka** sa bilo kojim drugim hardverom (koji nije proizveo **Prodavac**) nalaze se u sekciji "Posebni uslovi korišćenja uFCoder biblioteke" ovog **Ugovora**. + +8. **Korisniku licence** je zabranjeno da prodaje, poklanja, objavljuje, iznajmljuje ili na drugi način ustupa samostalne **Biblioteke** ili bilo koji njihov deo bilo kojoj trećoj strani, osim ako je to izričito dozvoljeno u ovoj **Licenci**. + +9. **Korisniku licence** je zabranjeno da koristi **Biblioteke** i/ili njihove materijale na bilo koji način koji bi doveo do toga da potpadne pod bilo koju licencu otvorenog koda (Open source licence). Na primer, **Korisniku licence** je zabranjeno da ugradi **Biblioteke** i/ili njene materijale u svoj projekat, a zatim ga u celini licencira pod bilo kojom licencom otvorenog koda ili sličnom licencom. Na taj način bi neka od ograničenja propisanih ovom **Licencom** bila nezakonito opozvana i **Korisnik licence** bi u takvom slučaju snosio svu odgovornost. + +10. **Korisniku licence** je zabranjeno da koristi **Biblioteke** na bilo koji nezakonit način ili da ih koristi za razvoj ili prenošenje zlonamernog koda, a takođe je u obavezi da poštuje sve nacionalne i međunarodne zakone, pravila i propise u vezi sa njihovim korišćenjem. + +11. **Korisniku licence** je zabranjeno da koristi **Biblioteke** na bilo koji način koji nije dozvoljen ovim **Ugovorom**. + + +## Posebni uslovi korišćenja uFCoder biblioteke +(korišćenje bez uFR čitača/ programatora beskontaktnih kartica) + +Napomena: Ukoliko koristite uFCoder **Biblioteku** za Android ili iOS platformu sa uređajima na koji je priključen neki od [uFR NFC čitača/programatora](https://webshop.d-logic.net/products/nfc-rfid-reader-writer/ufr-series-dev-tools-with-sdk.html) iz proizvodnog programa firme Digital Logic - ne plaćate bilo kakvu naknadu i na vas se ne odnose uslovi navedeni u paragrafima od 12 do 17. + + +12. Ukoliko koristite uFCoder **Biblioteku** za Android ili iOS platformu bez uređaja uFR serije primenjuju se sledeći uslovi: + +13. Za korisnike koji ne koriste uređaje iz uFR serije NFC čitača razvijen je namenski sistem licenciranja. +Svaki korisnik dobija 10 besplatnih licenci, odnosno mogućnost da besplatno koristi biblioteku na 10 različitih uređaja. +Package name aplikacije i Hardware ID koji generiše Android ili iOS okruženje, koriste se za praćenje broja licenci koje aplikacija koristi pozivajući se na isti naziv paketa (package name). Svaki korisnik, prilikom kreiranja aplikacije koja koristi uFR biblioteku, dužan je da definiše svoj jedinstven naziv paketa. + +14. Ukoliko **Korisnik** želi da **Biblioteku** koristi sa brojem uređaja koji prelazi 10 moći će da uplati dodatne licence po sledećem cenovniku: + +Broj licenci - Mesečna cena po licenci/uređaju + +1-10 - besplatno +10-100 - 0.85 € bez PDV-a po uređaju +100-500 - 0.80 € bez PDV-a po uređaju +500-1000 - 0.75 € bez PDV-a po uređaju +1000+ - 0.70 € bez PDV-a po uređaju + + +15. Fakturisanje se vrši na kraju meseca za broj uređaja (licenci) koji je koristio **Biblioteku**. Rok za plaćanje fakturisanog iznosa je najkasnije 7 dana od dana fakturisanja. + +16. Na zahtev, **Korisnik** može dobiti listing u kome se vidi broj pristupanja **Biblioteci** od strane pojedinačnih uređaja vezanih za **Korisnikov** package name. + +17. Ukoliko broj uređaja koji koriste **Biblioteku** pod istim package name-om pređe 10 a **Korisnik** ne podnese zahtev za davanje dodatnih **Licenci** ili ukoliko svoja dugovanja ne izmiri na vreme, zadržavamo pravo da mu ukinemo mogućnost korišćenja funkcija **Biblioteke**. + +18. Dodatne informacije u vezi licenciranja možete dobiti na adresu: licencing@d-logic.com + + +## Autorsko pravo i intelektualna svojina + +19. Sva prava na vlasništvo, autorska prava, distribuciju, intelektualna i imovinska prava ostaju isključivo u vlasništvu **Prodavca**. Ovaj **Ugovor** se odnosi samo na licenciranje korišćenja i ne daje **Korisniku licence** bilo kakvo pravo da prisvoji i/ili prenese vlasništvo na bilo koji način. + +20. **Biblioteke** mogu sadržati delove koda drugih autora pod određenim licencama koje će uvek biti vidljive i ispravno naglašene u pratećoj dokumentaciji. + +21. Na zahtev, izvorni kod biblioteke se može dostaviti **Korisniku licence**, uz obavezno zaključivanje NDA ugovora sa **Prodavcem**. + + +## Uslovi prihvatanja + +22. Smatra se da su svi uslovi, obaveze i uslovi ovog **Ugovora** prihvaćeni pribavljanjem bilo koje verzije **Biblioteka** koja podleže ovoj licenci, bilo preuzimanjem sa web lokacije prodavca ili na bilo koji drugi način. + + +## Bezbednost + +23. **Korisnici licence** su isključivo odgovorni za primenu **Biblioteka** u svom projektu, uključujući bezbednosna pitanja. Ova odgovornost se odnosi, ali ne ograničava, na izloženost ličnih padataka korisnika. + + +## Ograničenje odgovornosti + +24. Ove **Biblioteke** su obezbeđene „kao što jesu“ i **Prodavac** ne daje **NIKAKVE GARANCIJE**, izričite, podrazumevane, zakonske ili druge. **Korisnik licence** je u obavezi da kontroliše, testira i održava bezbednost njegovog korišćenja. + +25. **Prodavac** neće biti odgovoran za bilo kakvu štetu nastalu korišćenjem **Biblioteke** i njenih materijala. Uključujući, ali ne ograničavajući se na: gubitak dobiti, gubitak podataka, gubitak upotrebe, izlaganje poverljivim informacijama, prekid poslovanja, lične povrede, oštećenje imovine ili bilo koji drugi oblik štete. + + +## Merodavno pravo i mesto održavanja + +26. Ovaj **Ugovor** je vođen zakonima Republike Srbije sa nadležnim Sudom u Požarevcu - u vezi sa svim zahtevima, postupcima i tužbama u vezi sa ovim **Ugovorom** o licenci. + + +## Izmene Ugovora o licenci + +27. **Prodavac** zadržava pravo da promeni sadržaj ovog **Ugovora** o licenci. Sve promene će biti objavljene na zvaničnom veb sajtu **Prodavca** koje su uključene u nove revizije **Ugovora** o licenci i stupiće na snagu ne pre 30 dana nakon objavljivanja promena. + + +## Kontakt informacije + +Kontakt prodavca: +Digital Logic Ltd. +Nemanjina 57A +12000 Požarevac +Srbija +Tel: +38112541022 +e-mail: legal@d-logic.com + diff --git a/lib/linux/aarch64/libuFCoder-aarch64.so b/lib/linux/aarch64/libuFCoder-aarch64.so new file mode 100644 index 0000000000000000000000000000000000000000..ce98a1fbc708131cc326f25f126364f64f121f45 Binary files /dev/null and b/lib/linux/aarch64/libuFCoder-aarch64.so differ diff --git a/lib/linux/arm-el/libuFCoder-armel.so b/lib/linux/arm-el/libuFCoder-armel.so new file mode 100644 index 0000000000000000000000000000000000000000..ac79c2e34dd6378eb0af4a54923f19ca251175e6 Binary files /dev/null and b/lib/linux/arm-el/libuFCoder-armel.so differ diff --git a/lib/linux/arm-hf/libuFCoder-armhf.so b/lib/linux/arm-hf/libuFCoder-armhf.so new file mode 100644 index 0000000000000000000000000000000000000000..19932aee24da90f543adb1cfe150029548f99fe8 Binary files /dev/null and b/lib/linux/arm-hf/libuFCoder-armhf.so differ diff --git a/lib/linux/static-aarch64/libuFCoder-aarch64.a b/lib/linux/static-aarch64/libuFCoder-aarch64.a new file mode 100644 index 0000000000000000000000000000000000000000..2233e87d01c4afb56ae6fc2026598baeef4b795b Binary files /dev/null and b/lib/linux/static-aarch64/libuFCoder-aarch64.a differ diff --git a/lib/linux/static-armel/libuFCoder-armel.a b/lib/linux/static-armel/libuFCoder-armel.a new file mode 100644 index 0000000000000000000000000000000000000000..032d92f14082605e94cf4f6cf486b553294fb36b Binary files /dev/null and b/lib/linux/static-armel/libuFCoder-armel.a differ diff --git a/lib/linux/static-armhf/libuFCoder-armhf.a b/lib/linux/static-armhf/libuFCoder-armhf.a new file mode 100644 index 0000000000000000000000000000000000000000..1ca09a61062b375a1ad72ab73b53f185c73e076f Binary files /dev/null and b/lib/linux/static-armhf/libuFCoder-armhf.a differ diff --git a/lib/linux/static-x86/libuFCoder-x86.a b/lib/linux/static-x86/libuFCoder-x86.a new file mode 100644 index 0000000000000000000000000000000000000000..2943cb96a63a6d975cd6958858a732d85d2a445f Binary files /dev/null and b/lib/linux/static-x86/libuFCoder-x86.a differ diff --git a/lib/linux/static-x86_64/libuFCoder-x86_64.a b/lib/linux/static-x86_64/libuFCoder-x86_64.a new file mode 100644 index 0000000000000000000000000000000000000000..6f2ed5156bcda8b5ee6bc40196c7e586c66235bd Binary files /dev/null and b/lib/linux/static-x86_64/libuFCoder-x86_64.a differ diff --git a/lib/linux/static-x86_64/readme.txt b/lib/linux/static-x86_64/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..9cae7bc2a7a53d0e2765f33e38afeaf619156f7e --- /dev/null +++ b/lib/linux/static-x86_64/readme.txt @@ -0,0 +1,3 @@ +When you use uFCoder static library, you must define DL_USE_STATIC_LIB macro before include uFCoder.h + +Additionally, add following linker flags "-lpthread -ldl" diff --git a/lib/linux/x86/libuFCoder-x86.so b/lib/linux/x86/libuFCoder-x86.so new file mode 100755 index 0000000000000000000000000000000000000000..b8adb1ab630471e9a2740450e13c3327dfb330c1 Binary files /dev/null and b/lib/linux/x86/libuFCoder-x86.so differ diff --git a/lib/linux/x86_64/libuFCoder-x86_64.so b/lib/linux/x86_64/libuFCoder-x86_64.so new file mode 100755 index 0000000000000000000000000000000000000000..ce66bed24a85f236572aa2dda6dfe722d3c07233 Binary files /dev/null and b/lib/linux/x86_64/libuFCoder-x86_64.so differ diff --git a/lib/macos/static-universal/libuFCoder-macos.a b/lib/macos/static-universal/libuFCoder-macos.a new file mode 100644 index 0000000000000000000000000000000000000000..53072cb01de8f3795a74bc4f660c5e950efae8a2 Binary files /dev/null and b/lib/macos/static-universal/libuFCoder-macos.a differ diff --git a/lib/macos/static-universal/readme.txt b/lib/macos/static-universal/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..bf1330133c9d0e3494f88e72734b45fed92e5cc1 --- /dev/null +++ b/lib/macos/static-universal/readme.txt @@ -0,0 +1,3 @@ +When you use uFCoder static library, you must define DL_USE_STATIC_LIB macro before include uFCoder.h + +Additionally, add following linker flags "-framework IOKit -framework CoreFoundation" diff --git a/lib/macos/static-x86_64/libuFCoder-x86_64.a b/lib/macos/static-x86_64/libuFCoder-x86_64.a new file mode 100644 index 0000000000000000000000000000000000000000..800bf813dbbcec7a489ebd97338abd8f43659ac6 Binary files /dev/null and b/lib/macos/static-x86_64/libuFCoder-x86_64.a differ diff --git a/lib/macos/static-x86_64/readme.txt b/lib/macos/static-x86_64/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..bf1330133c9d0e3494f88e72734b45fed92e5cc1 --- /dev/null +++ b/lib/macos/static-x86_64/readme.txt @@ -0,0 +1,3 @@ +When you use uFCoder static library, you must define DL_USE_STATIC_LIB macro before include uFCoder.h + +Additionally, add following linker flags "-framework IOKit -framework CoreFoundation" diff --git a/lib/macos/universal/libuFCoder-macos.dylib b/lib/macos/universal/libuFCoder-macos.dylib new file mode 100644 index 0000000000000000000000000000000000000000..2d4c65ae475551faac76a2de6fa548e7e2e45a72 Binary files /dev/null and b/lib/macos/universal/libuFCoder-macos.dylib differ diff --git a/lib/macos/x86_64/libuFCoder-x86_64.dylib b/lib/macos/x86_64/libuFCoder-x86_64.dylib new file mode 100755 index 0000000000000000000000000000000000000000..cc818c3af5d34d1c801555dab08cc8bcd5118b08 Binary files /dev/null and b/lib/macos/x86_64/libuFCoder-x86_64.dylib differ diff --git a/lib/windows/static-x86/ftd2xx_coff.lib b/lib/windows/static-x86/ftd2xx_coff.lib new file mode 100644 index 0000000000000000000000000000000000000000..5dc71ee5b31368fc7d69ceb1156ee5d7611b4467 Binary files /dev/null and b/lib/windows/static-x86/ftd2xx_coff.lib differ diff --git a/lib/windows/static-x86/libuFCoder-x86.a b/lib/windows/static-x86/libuFCoder-x86.a new file mode 100644 index 0000000000000000000000000000000000000000..33913886833779fe9a89bb6aa41b1e9fc2c9fabb Binary files /dev/null and b/lib/windows/static-x86/libuFCoder-x86.a differ diff --git a/lib/windows/static-x86/readme.txt b/lib/windows/static-x86/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..627dac1cb1e8786cef1c03fa44be9494b346e5c8 --- /dev/null +++ b/lib/windows/static-x86/readme.txt @@ -0,0 +1,6 @@ +When you use uFCoder static library, you must define DL_USE_STATIC_LIB macro before including the uFCoder.h + +After uFR-library version 4.4.1 an additional library [ws2_32.lib] must be included to support UDP transfer protocol +#pragma comment(lib, "ws2_32.lib") + +Additionally, linkage to "ftd2xx_coff.lib" is mandatory. diff --git a/lib/windows/static-x86_64/ftd2xx_coff_x64.lib b/lib/windows/static-x86_64/ftd2xx_coff_x64.lib new file mode 100644 index 0000000000000000000000000000000000000000..7b28fab0dbe62abcd38b6588f3702be7decbe218 Binary files /dev/null and b/lib/windows/static-x86_64/ftd2xx_coff_x64.lib differ diff --git a/lib/windows/static-x86_64/libuFCoder-x86_64.a b/lib/windows/static-x86_64/libuFCoder-x86_64.a new file mode 100644 index 0000000000000000000000000000000000000000..57af3c1c8cc579f8e3b1d1609cd98343b73e799c Binary files /dev/null and b/lib/windows/static-x86_64/libuFCoder-x86_64.a differ diff --git a/lib/windows/static-x86_64/readme.txt b/lib/windows/static-x86_64/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..2bd75b8225359a9e3ea1c2b173490d5f51baa629 --- /dev/null +++ b/lib/windows/static-x86_64/readme.txt @@ -0,0 +1,6 @@ +When you use uFCoder static library, you must define DL_USE_STATIC_LIB macro before including the uFCoder.h + +After uFR-library version 4.4.1 an additional library [ws2_32.lib] must be included to support UDP transfer protocol +#pragma comment(lib, "ws2_32.lib") + +Additionally, linkage to "ftd2xx_coff_x64.lib" is mandatory. diff --git a/lib/windows/uwp/uFCoder-arm.dll b/lib/windows/uwp/uFCoder-arm.dll new file mode 100644 index 0000000000000000000000000000000000000000..349c593fbf0c045758571249d0bf997afee52a4c Binary files /dev/null and b/lib/windows/uwp/uFCoder-arm.dll differ diff --git a/lib/windows/uwp/uFCoder-arm.lib b/lib/windows/uwp/uFCoder-arm.lib new file mode 100644 index 0000000000000000000000000000000000000000..6a9672729eb2652b44353854723d40b2dc2f54a9 Binary files /dev/null and b/lib/windows/uwp/uFCoder-arm.lib differ diff --git a/lib/windows/uwp/uFCoder-x86.dll b/lib/windows/uwp/uFCoder-x86.dll new file mode 100644 index 0000000000000000000000000000000000000000..a79ca4c7e12fd6b7d2613ed24dfb7847b7e310c6 Binary files /dev/null and b/lib/windows/uwp/uFCoder-x86.dll differ diff --git a/lib/windows/uwp/uFCoder-x86.lib b/lib/windows/uwp/uFCoder-x86.lib new file mode 100644 index 0000000000000000000000000000000000000000..3be912898ffde70cdf17990fb4b8abdb7d52f810 Binary files /dev/null and b/lib/windows/uwp/uFCoder-x86.lib differ diff --git a/lib/windows/uwp/uFCoder-x86_64.dll b/lib/windows/uwp/uFCoder-x86_64.dll new file mode 100644 index 0000000000000000000000000000000000000000..8f8349c93aececdaa8b4b8499d362f189b99fdcd Binary files /dev/null and b/lib/windows/uwp/uFCoder-x86_64.dll differ diff --git a/lib/windows/uwp/uFCoder-x86_64.lib b/lib/windows/uwp/uFCoder-x86_64.lib new file mode 100644 index 0000000000000000000000000000000000000000..bc3dc5638acd37dcfdad891b22336e06616efc03 Binary files /dev/null and b/lib/windows/uwp/uFCoder-x86_64.lib differ diff --git a/lib/windows/uwp/uwp-serial-arm.dll b/lib/windows/uwp/uwp-serial-arm.dll new file mode 100644 index 0000000000000000000000000000000000000000..88216214537effaa7b513d98f9e066dcd6ff82d5 Binary files /dev/null and b/lib/windows/uwp/uwp-serial-arm.dll differ diff --git a/lib/windows/uwp/uwp-serial-arm.lib b/lib/windows/uwp/uwp-serial-arm.lib new file mode 100644 index 0000000000000000000000000000000000000000..ffe168ffd0d87d7b79e72406ebc4b21c532ae9bf Binary files /dev/null and b/lib/windows/uwp/uwp-serial-arm.lib differ diff --git a/lib/windows/uwp/uwp-serial-x86.dll b/lib/windows/uwp/uwp-serial-x86.dll new file mode 100644 index 0000000000000000000000000000000000000000..816ff4ac57365891500f495a2db6498b6242da40 Binary files /dev/null and b/lib/windows/uwp/uwp-serial-x86.dll differ diff --git a/lib/windows/uwp/uwp-serial-x86.lib b/lib/windows/uwp/uwp-serial-x86.lib new file mode 100644 index 0000000000000000000000000000000000000000..ed19e6fb8bc73c744c9bb7af83ad72235f24da26 Binary files /dev/null and b/lib/windows/uwp/uwp-serial-x86.lib differ diff --git a/lib/windows/uwp/uwp-serial-x86_64.dll b/lib/windows/uwp/uwp-serial-x86_64.dll new file mode 100644 index 0000000000000000000000000000000000000000..325a1b68eec9f504162c0dec5cc534b1ab9e481f Binary files /dev/null and b/lib/windows/uwp/uwp-serial-x86_64.dll differ diff --git a/lib/windows/uwp/uwp-serial-x86_64.lib b/lib/windows/uwp/uwp-serial-x86_64.lib new file mode 100644 index 0000000000000000000000000000000000000000..5d911d37e5f5b849d689b56248ce5d0ce2341cef Binary files /dev/null and b/lib/windows/uwp/uwp-serial-x86_64.lib differ diff --git a/lib/windows/x86/COMuFCoder-x86.dll b/lib/windows/x86/COMuFCoder-x86.dll new file mode 100644 index 0000000000000000000000000000000000000000..d7b8827855b907a39370984efa864161cf1f35d1 Binary files /dev/null and b/lib/windows/x86/COMuFCoder-x86.dll differ diff --git a/lib/windows/x86/COMuFCoder-x86.tlb b/lib/windows/x86/COMuFCoder-x86.tlb new file mode 100644 index 0000000000000000000000000000000000000000..0a671405abf8dc733cf3a7f1b5128d23a6b7ed6a Binary files /dev/null and b/lib/windows/x86/COMuFCoder-x86.tlb differ diff --git a/lib/windows/x86/libeay32.dll b/lib/windows/x86/libeay32.dll new file mode 100644 index 0000000000000000000000000000000000000000..c5d13a133b57922872c22a8891c31982f1454cf3 Binary files /dev/null and b/lib/windows/x86/libeay32.dll differ diff --git a/lib/windows/x86/readme.md b/lib/windows/x86/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..026b8a3c5dab3036d0c3b93392f022be97b5dd80 --- /dev/null +++ b/lib/windows/x86/readme.md @@ -0,0 +1,22 @@ + +# New Feature - COM wrapper for uFCoder library + +Implemented Component Object Model wrapper for uFCoder library. + +``` +COMuFCoder-x86.dll +``` + +## How to register COM library + +``` +regasm COMuFCoder-x86.dll /codebase +``` +response: +``` +Microsoft .NET Framework Assembly Registration Utility version 4.7.3056.0 +for Microsoft .NET Framework version 4.7.3056.0 +Copyright (C) Microsoft Corporation. All rights reserved. + +Types registered successfully +``` diff --git a/lib/windows/x86/uFCoder-x86.def b/lib/windows/x86/uFCoder-x86.def new file mode 100644 index 0000000000000000000000000000000000000000..367a34ca0f419046a0d1f1000cb3c20dc3ab1891 --- /dev/null +++ b/lib/windows/x86/uFCoder-x86.def @@ -0,0 +1,2230 @@ +EXPORTS + AES_to_DES_key_type = AES_to_DES_key_type@0 @1 + APDUHexStrTransceive = APDUHexStrTransceive@8 @2 + APDUHexStrTransceiveM = APDUHexStrTransceiveM@12 @3 + APDUPlainTransceive = APDUPlainTransceive@16 @4 + APDUPlainTransceiveM = APDUPlainTransceiveM@20 @5 + APDUPlainTransceiveToHeap = APDUPlainTransceiveToHeap@16 @6 + APDUPlainTransceiveToHeapM = APDUPlainTransceiveToHeapM@20 @7 + APDUTransceive = APDUTransceive@40 @8 + APDUTransceiveM = APDUTransceiveM@44 @9 + APDU_switch_off_from_ISO7816_interface = APDU_switch_off_from_ISO7816_interface@0 @10 + APDU_switch_off_from_ISO7816_interfaceM = APDU_switch_off_from_ISO7816_interfaceM@4 @11 + APDU_switch_to_ISO14443_4_interface = APDU_switch_to_ISO14443_4_interface@0 @12 + APDU_switch_to_ISO14443_4_interfaceM = APDU_switch_to_ISO14443_4_interfaceM@4 @13 + APDU_switch_to_ISO7816_interface = APDU_switch_to_ISO7816_interface@0 @14 + APDU_switch_to_ISO7816_interfaceM = APDU_switch_to_ISO7816_interfaceM@4 @15 + ATECC608LockConfig = ATECC608LockConfig@0 @16 + ATECC608LockConfigM = ATECC608LockConfigM@4 @17 + ATECC608LockDataAndOtp = ATECC608LockDataAndOtp@0 @18 + ATECC608LockDataAndOtpM = ATECC608LockDataAndOtpM@4 @19 + ATECC608LockKeySlot = ATECC608LockKeySlot@4 @20 + ATECC608LockKeySlotM = ATECC608LockKeySlotM@8 @21 + AdHocEmulationStart = AdHocEmulationStart@0 @22 + AdHocEmulationStartM = AdHocEmulationStartM@4 @23 + AdHocEmulationStop = AdHocEmulationStop@0 @24 + AdHocEmulationStopM = AdHocEmulationStopM@4 @25 + AutoSleepGet = AutoSleepGet@4 @26 + AutoSleepGetM = AutoSleepGetM@8 @27 + AutoSleepSet = AutoSleepSet@4 @28 + AutoSleepSetM = AutoSleepSetM@8 @29 + BalanceGet = BalanceGet@12 @30 + BalanceGetM = BalanceGetM@16 @31 + BalanceSet = BalanceSet@12 @32 + BalanceSetM = BalanceSetM@16 @33 + BlockInSectorRead = BlockInSectorRead@20 @34 + BlockInSectorReadM = BlockInSectorReadM@24 @35 + BlockInSectorReadSamKey = BlockInSectorReadSamKey@20 @36 + BlockInSectorReadSamkeyM = BlockInSectorReadSamkeyM@24 @37 + BlockInSectorRead_AKM1 = BlockInSectorRead_AKM1@16 @38 + BlockInSectorRead_AKM1M = BlockInSectorRead_AKM1M@20 @39 + BlockInSectorRead_AKM2 = BlockInSectorRead_AKM2@16 @40 + BlockInSectorRead_AKM2M = BlockInSectorRead_AKM2M@20 @41 + BlockInSectorRead_PK = BlockInSectorRead_PK@20 @42 + BlockInSectorRead_PKM = BlockInSectorRead_PKM@24 @43 + BlockInSectorWrite = BlockInSectorWrite@20 @44 + BlockInSectorWriteM = BlockInSectorWriteM@24 @45 + BlockInSectorWriteSamKey = BlockInSectorWriteSamKey@20 @46 + BlockInSectorWriteSamkeyM = BlockInSectorWriteSamkeyM@24 @47 + BlockInSectorWrite_AKM1 = BlockInSectorWrite_AKM1@16 @48 + BlockInSectorWrite_AKM1M = BlockInSectorWrite_AKM1M@20 @49 + BlockInSectorWrite_AKM2 = BlockInSectorWrite_AKM2@16 @50 + BlockInSectorWrite_AKM2M = BlockInSectorWrite_AKM2M@20 @51 + BlockInSectorWrite_PK = BlockInSectorWrite_PK@20 @52 + BlockInSectorWrite_PKM = BlockInSectorWrite_PKM@24 @53 + BlockRead = BlockRead@16 @54 + BlockReadM = BlockReadM@20 @55 + BlockReadSamKey = BlockReadSamKey@16 @56 + BlockReadSamKeyM = BlockReadSamKeyM@20 @57 + BlockRead_AKM1 = BlockRead_AKM1@12 @58 + BlockRead_AKM1M = BlockRead_AKM1M@16 @59 + BlockRead_AKM2 = BlockRead_AKM2@12 @60 + BlockRead_AKM2M = BlockRead_AKM2M@16 @61 + BlockRead_PK = BlockRead_PK@16 @62 + BlockRead_PKM = BlockRead_PKM@20 @63 + BlockWrite = BlockWrite@16 @64 + BlockWriteM = BlockWriteM@20 @65 + BlockWriteSamKey = BlockWriteSamKey@16 @66 + BlockWriteSamKeyM = BlockWriteSamKeyM@20 @67 + BlockWrite_AKM1 = BlockWrite_AKM1@12 @68 + BlockWrite_AKM1M = BlockWrite_AKM1M@16 @69 + BlockWrite_AKM2 = BlockWrite_AKM2@12 @70 + BlockWrite_AKM2M = BlockWrite_AKM2M@16 @71 + BlockWrite_PK = BlockWrite_PK@16 @72 + BlockWrite_PKM = BlockWrite_PKM@20 @73 + BootReader = BootReader@0 @74 + BusAdminCardMake = BusAdminCardMake@8 @75 + COMTransceive = COMTransceive@32 @76 + COMTransceiveM = COMTransceiveM@36 @77 + CardEncryption_GetActualCardSN = CardEncryption_GetActualCardSN@8 @78 + CardEncryption_GetActualCardSNM = CardEncryption_GetActualCardSNM@12 @79 + CardEncryption_GetJobSN = CardEncryption_GetJobSN@4 @80 + CardEncryption_GetJobSNM = CardEncryption_GetJobSNM@8 @81 + CardEncryption_GetNext = CardEncryption_GetNext@28 @82 + CardEncryption_GetNextEncryptedCard = CardEncryption_GetNextEncryptedCard@12 @83 + CardEncryption_GetNextEncryptedCardM = CardEncryption_GetNextEncryptedCardM@16 @84 + CardEncryption_GetNextM = CardEncryption_GetNextM@32 @85 + CardEncryption_GetSalterSN = CardEncryption_GetSalterSN@8 @86 + CardEncryption_GetSalterSNM = CardEncryption_GetSalterSNM@12 @87 + CardEncryption_Initialize = CardEncryption_Initialize@8 @88 + CardEncryption_InitializeM = CardEncryption_InitializeM@12 @89 + ChangeReaderJobId = ChangeReaderJobId@8 @90 + ChangeReaderJobIdM = ChangeReaderJobIdM@12 @91 + ChangeReaderPassword = ChangeReaderPassword@8 @92 + ChangeReaderPasswordM = ChangeReaderPasswordM@12 @93 + CheckUidChangeable = CheckUidChangeable@0 @94 + CheckUidChangeableM = CheckUidChangeableM@4 @95 + CombinedModeEmulationStart = CombinedModeEmulationStart@0 @96 + CombinedModeEmulationStartM = CombinedModeEmulationStartM@4 @97 + DES_to_AES_key_type = DES_to_AES_key_type@0 @98 + DLFree = DLFree@4 @99 + DLGetEccCurveName = DLGetEccCurveName@4 @100 + DLGetHash = DLGetHash@20 @101 + DLGetHashName = DLGetHashName@4 @102 + DLGetHashOutputByteLength = DLGetHashOutputByteLength@8 @103 + DLGetHashToHeap = DLGetHashToHeap@20 @104 + DLGetSignatureSchemeName = DLGetSignatureSchemeName@4 @105 + DLHashFinishChunked = DLHashFinishChunked@8 @106 + DLHashFinishChunkedToHeap = DLHashFinishChunkedToHeap@8 @107 + DLHashInitChunked = DLHashInitChunked@4 @108 + DLHashUpdateChunked = DLHashUpdateChunked@8 @109 + DL_TLS_Request = DL_TLS_Request@28 @110 + DL_TLS_SetClientCertificate = DL_TLS_SetClientCertificate@12 @111 + DL_TLS_SetClientX509PrivateKey_PEM = DL_TLS_SetClientX509PrivateKey_PEM@8 @112 + DefaultBaudrateFlashCheck = DefaultBaudrateFlashCheck@0 @113 + DefaultBaudrateFlashCheckM = DefaultBaudrateFlashCheckM@4 @114 + DeslectCard = DeslectCard@0 @115 + DeslectCardM = DeslectCardM@4 @116 + DigitalSignatureVerifyHash = DigitalSignatureVerifyHash@52 @117 + DisableAntiCollision = DisableAntiCollision@0 @118 + DisableAntiCollisionM = DisableAntiCollisionM@4 @119 + Display_EraseSection = Display_EraseSection@16 @120 + Display_PrintText = Display_PrintText@24 @121 + Display_SaveBitmapToGallery = Display_SaveBitmapToGallery@8 @122 + Display_SaveSystemBitmap = Display_SaveSystemBitmap@8 @123 + Display_ShowBitmap = Display_ShowBitmap@16 @124 + Display_ShowBitmapFromGallery = Display_ShowBitmapFromGallery@4 @125 + Display_ShowLastUnsavedImage = Display_ShowLastUnsavedImage@0 @126 + Display_ShowTime = Display_ShowTime@8 @127 + Display_Transmit = Display_Transmit@12 @128 + Display_UserInterfaceSignal = Display_UserInterfaceSignal@4 @129 + EE_Lock = EE_Lock@8 @130 + EE_Password_Change = EE_Password_Change@8 @131 + EE_Read = EE_Read@12 @132 + EE_Write = EE_Write@12 @133 + EMV_GetLastTransaction = EMV_GetLastTransaction@8 @134 + EMV_GetPAN = EMV_GetPAN@8 @135 + EnableAntiCollision = EnableAntiCollision@0 @136 + EnableAntiCollisionM = EnableAntiCollisionM@4 @137 + EnterShareRamCommMode = EnterShareRamCommMode@0 @138 + EnterShareRamCommModeM = EnterShareRamCommModeM@4 @139 + EnumCards = EnumCards@8 @140 + EnumCardsM = EnumCardsM@12 @141 + EspChangeReaderPassword = EspChangeReaderPassword@8 @142 + EspChangeReaderPasswordM = EspChangeReaderPasswordM@12 @143 + EspDisableWifi = EspDisableWifi@0 @144 + EspDisableWifiM = EspDisableWifiM@4 @145 + EspEnableWifi = EspEnableWifi@0 @146 + EspEnableWifiM = EspEnableWifiM@4 @147 + EspGetFirmwareVersion = EspGetFirmwareVersion@12 @148 + EspGetFirmwareVersionM = EspGetFirmwareVersionM@16 @149 + EspGetIOState = EspGetIOState@4 @150 + EspGetIOStateM = EspGetIOStateM@8 @151 + EspGetReaderSerialNumber = EspGetReaderSerialNumber@4 @152 + EspGetReaderSerialNumberM = EspGetReaderSerialNumberM@8 @153 + EspGetReaderTime = EspGetReaderTime@4 @154 + EspGetReaderTimeM = EspGetReaderTimeM@8 @155 + EspGetTransparentReaders = EspGetTransparentReaders@4 @156 + EspReaderEepromRead = EspReaderEepromRead@12 @157 + EspReaderEepromReadM = EspReaderEepromReadM@16 @158 + EspReaderEepromWrite = EspReaderEepromWrite@16 @159 + EspReaderEepromWriteM = EspReaderEepromWriteM@20 @160 + EspReaderReset = EspReaderReset@0 @161 + EspReaderResetM = EspReaderResetM@4 @162 + EspSetDisplayData = EspSetDisplayData@12 @163 + EspSetDisplayDataM = EspSetDisplayDataM@16 @164 + EspSetIOState = EspSetIOState@8 @165 + EspSetIOStateM = EspSetIOStateM@12 @166 + EspSetReaderTime = EspSetReaderTime@8 @167 + EspSetReaderTimeM = EspSetReaderTimeM@12 @168 + EspSetTransparentReader = EspSetTransparentReader@4 @169 + EspSetTransparentReaderM = EspSetTransparentReaderM@8 @170 + EspSetTransparentReaderSession = EspSetTransparentReaderSession@4 @171 + EspTurnOff = EspTurnOff@0 @172 + EspTurnOffM = EspTurnOffM@4 @173 + ExitShareRamCommMode = ExitShareRamCommMode@0 @174 + ExitShareRamCommModeM = ExitShareRamCommModeM@4 @175 + FastFlashCheck = FastFlashCheck@0 @176 + FastFlashCheckM = FastFlashCheckM@4 @177 + GetATECC608ConfigZone = GetATECC608ConfigZone@4 @178 + GetATECC608ConfigZoneM = GetATECC608ConfigZoneM@8 @179 + GetATECC608InfoRevision = GetATECC608InfoRevision@4 @180 + GetATECC608InfoRevisionM = GetATECC608InfoRevisionM@8 @181 + GetATECC608OtpZone = GetATECC608OtpZone@4 @182 + GetATECC608OtpZoneM = GetATECC608OtpZoneM@8 @183 + GetATECC608ZonesLockStatus = GetATECC608ZonesLockStatus@8 @184 + GetATECC608ZonesLockStatusM = GetATECC608ZonesLockStatusM@12 @185 + GetAdHocEmulationParams = GetAdHocEmulationParams@20 @186 + GetAdHocEmulationParamsM = GetAdHocEmulationParamsM@24 @187 + GetAntiCollisionStatus = GetAntiCollisionStatus@8 @188 + GetAntiCollisionStatusM = GetAntiCollisionStatusM@12 @189 + GetAsyncCardIdSendConfig = GetAsyncCardIdSendConfig@24 @190 + GetAsyncCardIdSendConfigEx = GetAsyncCardIdSendConfigEx@32 @191 + GetAsyncCardIdSendConfigExM = GetAsyncCardIdSendConfigExM@36 @192 + GetAsyncCardIdSendConfigM = GetAsyncCardIdSendConfigM@28 @193 + GetAtqaSak = GetAtqaSak@8 @194 + GetAtqaSakM = GetAtqaSakM@12 @195 + GetBuildNumber = GetBuildNumber@4 @196 + GetBuildNumberM = GetBuildNumberM@8 @197 + GetCardId = GetCardId@8 @198 + GetCardIdEx = GetCardIdEx@12 @199 + GetCardIdExM = GetCardIdExM@16 @200 + GetCardIdM = GetCardIdM@12 @201 + GetCardManufacturer = GetCardManufacturer@4 @202 + GetCardManufacturerM = GetCardManufacturerM@8 @203 + GetCardSize = GetCardSize@8 @204 + GetCardSizeM = GetCardSizeM@12 @205 + GetCustomUiConfig = GetCustomUiConfig@20 @206 + GetCustomUiConfigM = GetCustomUiConfigM@24 @207 + GetDiscoveryLoopSetup = GetDiscoveryLoopSetup@8 @208 + GetDiscoveryLoopSetupM = GetDiscoveryLoopSetupM@12 @209 + GetDisplayIntensity = GetDisplayIntensity@4 @210 + GetDisplayIntensityM = GetDisplayIntensityM@8 @211 + GetDllVersion = GetDllVersion@0 @212 + GetDllVersionStr = GetDllVersionStr@0 @213 + GetDlogicCardType = GetDlogicCardType@4 @214 + GetDlogicCardTypeM = GetDlogicCardTypeM@8 @215 + GetExternalFieldState = GetExternalFieldState@4 @216 + GetExternalFieldStateM = GetExternalFieldStateM@8 @217 + GetFtdiDriverVersion = GetFtdiDriverVersion@12 @218 + GetFtdiDriverVersionM = GetFtdiDriverVersionM@16 @219 + GetFtdiDriverVersionStr = GetFtdiDriverVersionStr@4 @220 + GetFtdiDriverVersionStrM = GetFtdiDriverVersionStrM@8 @221 + GetLastCardIdEx = GetLastCardIdEx@12 @222 + GetLastCardIdExM = GetLastCardIdExM@16 @223 + GetLicenseRequestData = GetLicenseRequestData@8 @224 + GetMobileAdditionalData = GetMobileAdditionalData@8 @225 + GetMobileAdditionalDataM = GetMobileAdditionalDataM@12 @226 + GetMobileUniqueIdAid = GetMobileUniqueIdAid@8 @227 + GetMobileUniqueIdAidM = GetMobileUniqueIdAidM@12 @228 + GetNfcT2TVersion = GetNfcT2TVersion@4 @229 + GetNfcT2TVersionM = GetNfcT2TVersionM@8 @230 + GetReaderDescription = GetReaderDescription@0 @231 + GetReaderDescriptionM = GetReaderDescriptionM@4 @232 + GetReaderFirmwareVersion = GetReaderFirmwareVersion@8 @233 + GetReaderFirmwareVersionM = GetReaderFirmwareVersionM@12 @234 + GetReaderHardwareVersion = GetReaderHardwareVersion@8 @235 + GetReaderHardwareVersionM = GetReaderHardwareVersionM@12 @236 + GetReaderParameters = GetReaderParameters@32 @237 + GetReaderParametersDefaultBaudrate = GetReaderParametersDefaultBaudrate@32 @238 + GetReaderParametersDefaultBaudrateM = GetReaderParametersDefaultBaudrateM@36 @239 + GetReaderParametersM = GetReaderParametersM@36 @240 + GetReaderParametersPN7462 = GetReaderParametersPN7462@32 @241 + GetReaderParametersPN7462_M = GetReaderParametersPN7462_M@36 @242 + GetReaderProMode = GetReaderProMode@8 @243 + GetReaderProModeM = GetReaderProModeM@12 @244 + GetReaderSerialDescription = GetReaderSerialDescription@4 @245 + GetReaderSerialDescriptionM = GetReaderSerialDescriptionM@8 @246 + GetReaderSerialNumber = GetReaderSerialNumber@4 @247 + GetReaderSerialNumberM = GetReaderSerialNumberM@8 @248 + GetReaderStatus = GetReaderStatus@16 @249 + GetReaderStatusEx = GetReaderStatusEx@8 @250 + GetReaderStatusExM = GetReaderStatusExM@12 @251 + GetReaderStatusM = GetReaderStatusM@20 @252 + GetReaderTime = GetReaderTime@4 @253 + GetReaderTimeM = GetReaderTimeM@8 @254 + GetReaderType = GetReaderType@4 @255 + GetReaderTypeM = GetReaderTypeM@8 @256 + GetRfAnalogRegistersISO14443_212 = GetRfAnalogRegistersISO14443_212@20 @257 + GetRfAnalogRegistersISO14443_212M = GetRfAnalogRegistersISO14443_212M@24 @258 + GetRfAnalogRegistersISO14443_424 = GetRfAnalogRegistersISO14443_424@20 @259 + GetRfAnalogRegistersISO14443_424M = GetRfAnalogRegistersISO14443_424M@24 @260 + GetRfAnalogRegistersTypeA = GetRfAnalogRegistersTypeA@20 @261 + GetRfAnalogRegistersTypeAM = GetRfAnalogRegistersTypeAM@24 @262 + GetRfAnalogRegistersTypeATrans = GetRfAnalogRegistersTypeATrans@40 @263 + GetRfAnalogRegistersTypeATransM = GetRfAnalogRegistersTypeATransM@44 @264 + GetRfAnalogRegistersTypeB = GetRfAnalogRegistersTypeB@20 @265 + GetRfAnalogRegistersTypeBM = GetRfAnalogRegistersTypeBM@24 @266 + GetRfAnalogRegistersTypeBTrans = GetRfAnalogRegistersTypeBTrans@36 @267 + GetRfAnalogRegistersTypeBTransM = GetRfAnalogRegistersTypeBTransM@40 @268 + GetRgbIntensity = GetRgbIntensity@4 @269 + GetRgbIntensityM = GetRgbIntensityM@8 @270 + GetServiceData = GetServiceData@4 @271 + GetServiceDataM = GetServiceDataM@8 @272 + GetSpeedParameters = GetSpeedParameters@8 @273 + GetSpeedParametersM = GetSpeedParametersM@12 @274 + GreenLedBlinkingTurnOff = GreenLedBlinkingTurnOff@0 @275 + GreenLedBlinkingTurnOffM = GreenLedBlinkingTurnOffM@4 @276 + GreenLedBlinkingTurnOn = GreenLedBlinkingTurnOn@0 @277 + GreenLedBlinkingTurnOnM = GreenLedBlinkingTurnOnM@4 @278 + IncrementCounter = IncrementCounter@8 @279 + IncrementCounterM = IncrementCounterM@12 @280 + JCAppDeleteEcKeyPair = JCAppDeleteEcKeyPair@4 @281 + JCAppDeleteEcKeyPairM = JCAppDeleteEcKeyPairM@8 @282 + JCAppDeleteRsaKeyPair = JCAppDeleteRsaKeyPair@4 @283 + JCAppDeleteRsaKeyPairM = JCAppDeleteRsaKeyPairM@8 @284 + JCAppGenerateKeyPair = JCAppGenerateKeyPair@24 @285 + JCAppGenerateKeyPairM = JCAppGenerateKeyPairM@28 @286 + JCAppGenerateSignature = JCAppGenerateSignature@36 @287 + JCAppGenerateSignatureM = JCAppGenerateSignatureM@40 @288 + JCAppGetEcKeySizeBits = JCAppGetEcKeySizeBits@12 @289 + JCAppGetEcKeySizeBitsM = JCAppGetEcKeySizeBitsM@16 @290 + JCAppGetEcPublicKey = JCAppGetEcPublicKey@56 @291 + JCAppGetEcPublicKeyM = JCAppGetEcPublicKeyM@60 @292 + JCAppGetErrorDescription = JCAppGetErrorDescription@4 @293 + JCAppGetObj = JCAppGetObj@16 @294 + JCAppGetObjId = JCAppGetObjId@16 @295 + JCAppGetObjIdM = JCAppGetObjIdM@20 @296 + JCAppGetObjM = JCAppGetObjM@20 @297 + JCAppGetObjSubject = JCAppGetObjSubject@16 @298 + JCAppGetObjSubjectM = JCAppGetObjSubjectM@20 @299 + JCAppGetPinTriesRemaining = JCAppGetPinTriesRemaining@8 @300 + JCAppGetPinTriesRemainingM = JCAppGetPinTriesRemainingM@12 @301 + JCAppGetRsaPublicKey = JCAppGetRsaPublicKey@20 @302 + JCAppGetRsaPublicKeyM = JCAppGetRsaPublicKeyM@24 @303 + JCAppGetSignature = JCAppGetSignature@8 @304 + JCAppInvalidateCert = JCAppInvalidateCert@8 @305 + JCAppInvalidateCertM = JCAppInvalidateCertM@12 @306 + JCAppLogin = JCAppLogin@12 @307 + JCAppLoginM = JCAppLoginM@16 @308 + JCAppPinChange = JCAppPinChange@12 @309 + JCAppPinChangeM = JCAppPinChangeM@16 @310 + JCAppPinDisable = JCAppPinDisable@4 @311 + JCAppPinDisableM = JCAppPinDisableM@8 @312 + JCAppPinEnable = JCAppPinEnable@4 @313 + JCAppPinEnableM = JCAppPinEnableM@8 @314 + JCAppPinUnblock = JCAppPinUnblock@12 @315 + JCAppPinUnblockM = JCAppPinUnblockM@16 @316 + JCAppPutObj = JCAppPutObj@24 @317 + JCAppPutObjM = JCAppPutObjM@28 @318 + JCAppPutObjSubject = JCAppPutObjSubject@16 @319 + JCAppPutObjSubjectM = JCAppPutObjSubjectM@20 @320 + JCAppPutPrivateKey = JCAppPutPrivateKey@24 @321 + JCAppPutPrivateKeyM = JCAppPutPrivateKeyM@28 @322 + JCAppSelectByAid = JCAppSelectByAid@12 @323 + JCAppSelectByAidM = JCAppSelectByAidM@16 @324 + JCAppSignatureBegin = JCAppSignatureBegin@32 @325 + JCAppSignatureBeginM = JCAppSignatureBeginM@36 @326 + JCAppSignatureEnd = JCAppSignatureEnd@4 @327 + JCAppSignatureEndM = JCAppSignatureEndM@8 @328 + JCAppSignatureUpdate = JCAppSignatureUpdate@8 @329 + JCAppSignatureUpdateM = JCAppSignatureUpdateM@12 @330 + JCStorageDeleteFile = JCStorageDeleteFile@4 @331 + JCStorageDeleteFileM = JCStorageDeleteFileM@8 @332 + JCStorageGetFileSize = JCStorageGetFileSize@8 @333 + JCStorageGetFileSizeM = JCStorageGetFileSizeM@12 @334 + JCStorageGetFilesListSize = JCStorageGetFilesListSize@4 @335 + JCStorageGetFilesListSizeM = JCStorageGetFilesListSizeM@8 @336 + JCStorageListFiles = JCStorageListFiles@8 @337 + JCStorageListFilesM = JCStorageListFilesM@12 @338 + JCStorageReadFile = JCStorageReadFile@12 @339 + JCStorageReadFileM = JCStorageReadFileM@16 @340 + JCStorageReadFileToFileSystem = JCStorageReadFileToFileSystem@8 @341 + JCStorageReadFileToFileSystemM = JCStorageReadFileToFileSystemM@12 @342 + JCStorageWriteFile = JCStorageWriteFile@12 @343 + JCStorageWriteFileFromFileSystem = JCStorageWriteFileFromFileSystem@8 @344 + JCStorageWriteFileFromFileSystemM = JCStorageWriteFileFromFileSystemM@12 @345 + JCStorageWriteFileM = JCStorageWriteFileM@16 @346 + LinRowRead = LinRowRead@24 @347 + LinRowReadM = LinRowReadM@28 @348 + LinRowRead_AKM1 = LinRowRead_AKM1@20 @349 + LinRowRead_AKM1M = LinRowRead_AKM1M@24 @350 + LinRowRead_AKM2 = LinRowRead_AKM2@20 @351 + LinRowRead_AKM2M = LinRowRead_AKM2M@24 @352 + LinRowRead_PK = LinRowRead_PK@24 @353 + LinRowRead_PKM = LinRowRead_PKM@28 @354 + LinearFormatCard = LinearFormatCard@32 @355 + LinearFormatCardM = LinearFormatCardM@36 @356 + LinearFormatCard_AKM1 = LinearFormatCard_AKM1@28 @357 + LinearFormatCard_AKM1M = LinearFormatCard_AKM1M@32 @358 + LinearFormatCard_AKM2 = LinearFormatCard_AKM2@28 @359 + LinearFormatCard_AKM2M = LinearFormatCard_AKM2M@32 @360 + LinearFormatCard_PK = LinearFormatCard_PK@32 @361 + LinearFormatCard_PKM = LinearFormatCard_PKM@36 @362 + LinearRead = LinearRead@24 @363 + LinearReadM = LinearReadM@28 @364 + LinearReadSamKey = LinearReadSamKey@24 @365 + LinearReadSamKeyM = LinearReadSamKeyM@28 @366 + LinearRead_AKM1 = LinearRead_AKM1@20 @367 + LinearRead_AKM1M = LinearRead_AKM1M@24 @368 + LinearRead_AKM2 = LinearRead_AKM2@20 @369 + LinearRead_AKM2M = LinearRead_AKM2M@24 @370 + LinearRead_PK = LinearRead_PK@24 @371 + LinearRead_PKM = LinearRead_PKM@28 @372 + LinearWrite = LinearWrite@24 @373 + LinearWriteM = LinearWriteM@28 @374 + LinearWriteSamKey = LinearWriteSamKey@24 @375 + LinearWriteSamKeyM = LinearWriteSamKeyM@28 @376 + LinearWrite_AKM1 = LinearWrite_AKM1@20 @377 + LinearWrite_AKM1M = LinearWrite_AKM1M@24 @378 + LinearWrite_AKM2 = LinearWrite_AKM2@20 @379 + LinearWrite_AKM2M = LinearWrite_AKM2M@24 @380 + LinearWrite_PK = LinearWrite_PK@24 @381 + LinearWrite_PKM = LinearWrite_PKM@28 @382 + ListCards = ListCards@8 @383 + ListCardsM = ListCardsM@12 @384 + MFP_AesAuthSecurityLevel1 = MFP_AesAuthSecurityLevel1@4 @385 + MFP_AesAuthSecurityLevel1M = MFP_AesAuthSecurityLevel1M@8 @386 + MFP_AesAuthSecurityLevel1_PK = MFP_AesAuthSecurityLevel1_PK@4 @387 + MFP_AesAuthSecurityLevel1_PKM = MFP_AesAuthSecurityLevel1_PKM@8 @388 + MFP_ChangeConfigurationKey = MFP_ChangeConfigurationKey@8 @389 + MFP_ChangeConfigurationKeyM = MFP_ChangeConfigurationKeyM@12 @390 + MFP_ChangeConfigurationKeySamKey = MFP_ChangeConfigurationKeySamKey@8 @391 + MFP_ChangeConfigurationKeySamKeyM = MFP_ChangeConfigurationKeySamKeyM@12 @392 + MFP_ChangeConfigurationKey_PK = MFP_ChangeConfigurationKey_PK@8 @393 + MFP_ChangeConfigurationKey_PKM = MFP_ChangeConfigurationKey_PKM@12 @394 + MFP_ChangeMasterKey = MFP_ChangeMasterKey@8 @395 + MFP_ChangeMasterKeyM = MFP_ChangeMasterKeyM@12 @396 + MFP_ChangeMasterKeySamKey = MFP_ChangeMasterKeySamKey@8 @397 + MFP_ChangeMasterKeySamKeyM = MFP_ChangeMasterKeySamKeyM@12 @398 + MFP_ChangeMasterKey_PK = MFP_ChangeMasterKey_PK@8 @399 + MFP_ChangeMasterKey_PKM = MFP_ChangeMasterKey_PKM@12 @400 + MFP_ChangeSectorExtKey = MFP_ChangeSectorExtKey@20 @401 + MFP_ChangeSectorExtKeyM = MFP_ChangeSectorExtKeyM@24 @402 + MFP_ChangeSectorKey = MFP_ChangeSectorKey@16 @403 + MFP_ChangeSectorKeyExt_PK = MFP_ChangeSectorKeyExt_PK@20 @404 + MFP_ChangeSectorKeyExt_PKM = MFP_ChangeSectorKeyExt_PKM@24 @405 + MFP_ChangeSectorKeyM = MFP_ChangeSectorKeyM@20 @406 + MFP_ChangeSectorKeySamExtKey = MFP_ChangeSectorKeySamExtKey@20 @407 + MFP_ChangeSectorKeySamExtKeyM = MFP_ChangeSectorKeySamExtKeyM@24 @408 + MFP_ChangeSectorKeySamKey = MFP_ChangeSectorKeySamKey@16 @409 + MFP_ChangeSectorKeySamKeyM = MFP_ChangeSectorKeySamKeyM@20 @410 + MFP_ChangeSectorKey_PK = MFP_ChangeSectorKey_PK@16 @411 + MFP_ChangeSectorKey_PKM = MFP_ChangeSectorKey_PKM@20 @412 + MFP_ChangeVcPollingEncKey = MFP_ChangeVcPollingEncKey@8 @413 + MFP_ChangeVcPollingEncKeyM = MFP_ChangeVcPollingEncKeyM@12 @414 + MFP_ChangeVcPollingEncKeySamKey = MFP_ChangeVcPollingEncKeySamKey@8 @415 + MFP_ChangeVcPollingEncKeySamKeyM = MFP_ChangeVcPollingEncKeySamKeyM@12 @416 + MFP_ChangeVcPollingEncKey_PK = MFP_ChangeVcPollingEncKey_PK@8 @417 + MFP_ChangeVcPollingEncKey_PKM = MFP_ChangeVcPollingEncKey_PKM@12 @418 + MFP_ChangeVcPollingMacKey = MFP_ChangeVcPollingMacKey@8 @419 + MFP_ChangeVcPollingMacKeyM = MFP_ChangeVcPollingMacKeyM@12 @420 + MFP_ChangeVcPollingMacKeySamKey = MFP_ChangeVcPollingMacKeySamKey@8 @421 + MFP_ChangeVcPollingMacKeySamKeyM = MFP_ChangeVcPollingMacKeySamKeyM@12 @422 + MFP_ChangeVcPollingMacKey_PK = MFP_ChangeVcPollingMacKey_PK@8 @423 + MFP_ChangeVcPollingMacKey_PKM = MFP_ChangeVcPollingMacKey_PKM@12 @424 + MFP_CommitPerso = MFP_CommitPerso@0 @425 + MFP_CommitPersoM = MFP_CommitPersoM@4 @426 + MFP_FieldConfigurationSet = MFP_FieldConfigurationSet@12 @427 + MFP_FieldConfigurationSetM = MFP_FieldConfigurationSetM@16 @428 + MFP_FieldConfigurationSetSamKey = MFP_FieldConfigurationSetSamKey@12 @429 + MFP_FieldConfigurationSetSamKeyM = MFP_FieldConfigurationSetSamKeyM@16 @430 + MFP_FieldConfigurationSet_PK = MFP_FieldConfigurationSet_PK@12 @431 + MFP_FieldConfigurationSet_PKM = MFP_FieldConfigurationSet_PKM@16 @432 + MFP_GetUid = MFP_GetUid@16 @433 + MFP_GetUidM = MFP_GetUidM@20 @434 + MFP_GetUidSamKey = MFP_GetUidSamKey@16 @435 + MFP_GetUidSamKeyM = MFP_GetUidSamKeyM@20 @436 + MFP_GetUid_PK = MFP_GetUid_PK@16 @437 + MFP_GetUid_PKM = MFP_GetUid_PKM@20 @438 + MFP_PersonalizationMinimal = MFP_PersonalizationMinimal@36 @439 + MFP_PersonalizationMinimalM = MFP_PersonalizationMinimalM@40 @440 + MFP_SwitchToSecurityLevel3 = MFP_SwitchToSecurityLevel3@4 @441 + MFP_SwitchToSecurityLevel3M = MFP_SwitchToSecurityLevel3M@8 @442 + MFP_SwitchToSecurityLevel3_PK = MFP_SwitchToSecurityLevel3_PK@4 @443 + MFP_SwitchToSecurityLevel3_PKM = MFP_SwitchToSecurityLevel3_PKM@8 @444 + MFP_WritePerso = MFP_WritePerso@8 @445 + MFP_WritePersoM = MFP_WritePersoM@12 @446 + MRTDAppSelectAndAuthenticateBac = MRTDAppSelectAndAuthenticateBac@16 @447 + MRTDAppSelectAndAuthenticateBacM = MRTDAppSelectAndAuthenticateBacM@20 @448 + MRTDFileReadBacToHeap = MRTDFileReadBacToHeap@24 @449 + MRTDFileReadBacToHeapM = MRTDFileReadBacToHeapM@28 @450 + MRTDGetDGTagListFromCOM = MRTDGetDGTagListFromCOM@16 @451 + MRTDGetDgIndex = MRTDGetDgIndex@4 @452 + MRTDGetDgName = MRTDGetDgName@4 @453 + MRTDGetImageFromDG2 = MRTDGetImageFromDG2@20 @454 + MRTDGetImageFromDG2ToFile = MRTDGetImageFromDG2ToFile@12 @455 + MRTDParseDG1ToHeap = MRTDParseDG1ToHeap@16 @456 + MRTDValidate = MRTDValidate@28 @457 + MRTDValidateM = MRTDValidateM@32 @458 + MRTD_MRZDataToMRZProtoKey = MRTD_MRZDataToMRZProtoKey@16 @459 + MRTD_MRZSubjacentCheck = MRTD_MRZSubjacentCheck@4 @460 + MRTD_MRZSubjacentToMRZProtoKey = MRTD_MRZSubjacentToMRZProtoKey@8 @461 + NfcT2TSafeConvertVersion = NfcT2TSafeConvertVersion@8 @462 + Open_ISO7816_Generic = Open_ISO7816_Generic@8 @463 + Open_ISO7816_GenericM = Open_ISO7816_GenericM@12 @464 + OriginalityCheck = OriginalityCheck@16 @465 + PN7462_CodeProtect = PN7462_CodeProtect@0 @466 + PN7462_ESP32_boot_init = PN7462_ESP32_boot_init@8 @467 + PN7462_ExtField = PN7462_ExtField@0 @468 + PN7462_LpcdCalibration = PN7462_LpcdCalibration@8 @469 + PN7462_LpcdPerform = PN7462_LpcdPerform@16 @470 + PN7462_RfOff = PN7462_RfOff@0 @471 + PN7462_RfOn = PN7462_RfOn@0 @472 + PN7462_Test = PN7462_Test@4 @473 + PN7462_WriteParams = PN7462_WriteParams@24 @474 + PN7462_WriteParamsUsb = PN7462_WriteParamsUsb@24 @475 + ParamTest1 = ParamTest1@8 @476 + ParamTest2 = ParamTest2@8 @477 + ParseNdefMessage = ParseNdefMessage@16 @478 + ProgReader = ProgReader@16 @479 + ProgReaderStreamUsb = ProgReaderStreamUsb@8 @480 + ProgReaderUsb = ProgReaderUsb@16 @481 + ReadCounter = ReadCounter@8 @482 + ReadCounterM = ReadCounterM@12 @483 + ReadECCSignature = ReadECCSignature@16 @484 + ReadECCSignatureExt = ReadECCSignatureExt@20 @485 + ReadECCSignatureExtM = ReadECCSignatureExtM@24 @486 + ReadECCSignatureM = ReadECCSignatureM@20 @487 + ReadNFCCounter = ReadNFCCounter@4 @488 + ReadNFCCounterM = ReadNFCCounterM@8 @489 + ReadNFCCounterPwdAuth_PK = ReadNFCCounterPwdAuth_PK@8 @490 + ReadNFCCounterPwdAuth_PKM = ReadNFCCounterPwdAuth_PKM@12 @491 + ReadNFCCounterPwdAuth_RK = ReadNFCCounterPwdAuth_RK@8 @492 + ReadNFCCounterPwdAuth_RKM = ReadNFCCounterPwdAuth_RKM@12 @493 + ReadNdefRecord_Address = ReadNdefRecord_Address@4 @494 + ReadNdefRecord_AddressM = ReadNdefRecord_AddressM@8 @495 + ReadNdefRecord_AndroidApp = ReadNdefRecord_AndroidApp@4 @496 + ReadNdefRecord_AndroidAppM = ReadNdefRecord_AndroidAppM@8 @497 + ReadNdefRecord_BT = ReadNdefRecord_BT@4 @498 + ReadNdefRecord_BTM = ReadNdefRecord_BTM@8 @499 + ReadNdefRecord_Bitcoin = ReadNdefRecord_Bitcoin@12 @500 + ReadNdefRecord_BitcoinM = ReadNdefRecord_BitcoinM@16 @501 + ReadNdefRecord_Contact = ReadNdefRecord_Contact@4 @502 + ReadNdefRecord_ContactM = ReadNdefRecord_ContactM@8 @503 + ReadNdefRecord_Email = ReadNdefRecord_Email@12 @504 + ReadNdefRecord_EmailM = ReadNdefRecord_EmailM@16 @505 + ReadNdefRecord_GeoLocation = ReadNdefRecord_GeoLocation@8 @506 + ReadNdefRecord_GeoLocationM = ReadNdefRecord_GeoLocationM@12 @507 + ReadNdefRecord_NaviDestination = ReadNdefRecord_NaviDestination@4 @508 + ReadNdefRecord_NaviDestinationM = ReadNdefRecord_NaviDestinationM@8 @509 + ReadNdefRecord_Phone = ReadNdefRecord_Phone@4 @510 + ReadNdefRecord_PhoneM = ReadNdefRecord_PhoneM@8 @511 + ReadNdefRecord_SMS = ReadNdefRecord_SMS@8 @512 + ReadNdefRecord_SMSM = ReadNdefRecord_SMSM@12 @513 + ReadNdefRecord_Skype = ReadNdefRecord_Skype@8 @514 + ReadNdefRecord_SkypeM = ReadNdefRecord_SkypeM@12 @515 + ReadNdefRecord_StreetView = ReadNdefRecord_StreetView@8 @516 + ReadNdefRecord_StreetViewM = ReadNdefRecord_StreetViewM@12 @517 + ReadNdefRecord_Text = ReadNdefRecord_Text@4 @518 + ReadNdefRecord_TextM = ReadNdefRecord_TextM@8 @519 + ReadNdefRecord_Viber = ReadNdefRecord_Viber@4 @520 + ReadNdefRecord_ViberM = ReadNdefRecord_ViberM@8 @521 + ReadNdefRecord_Whatsapp = ReadNdefRecord_Whatsapp@4 @522 + ReadNdefRecord_WhatsappM = ReadNdefRecord_WhatsappM@8 @523 + ReadNdefRecord_WiFi = ReadNdefRecord_WiFi@16 @524 + ReadNdefRecord_WiFiM = ReadNdefRecord_WiFiM@20 @525 + ReadShareRam = ReadShareRam@12 @526 + ReadShareRamM = ReadShareRamM@16 @527 + ReadTTStatus = ReadTTStatus@8 @528 + ReadTTStatusM = ReadTTStatusM@12 @529 + ReadUserData = ReadUserData@4 @530 + ReadUserDataExt = ReadUserDataExt@4 @531 + ReadUserDataExtM = ReadUserDataExtM@8 @532 + ReadUserDataM = ReadUserDataM@8 @533 + ReaderClose = ReaderClose@0 @534 + ReaderCloseM = ReaderCloseM@4 @535 + ReaderEepromRead = ReaderEepromRead@12 @536 + ReaderEepromReadM = ReaderEepromReadM@16 @537 + ReaderEepromWrite = ReaderEepromWrite@16 @538 + ReaderEepromWriteM = ReaderEepromWriteM@20 @539 + ReaderHwReset = ReaderHwReset@0 @540 + ReaderKeyWrite = ReaderKeyWrite@8 @541 + ReaderKeyWriteM = ReaderKeyWriteM@12 @542 + ReaderKeysLock = ReaderKeysLock@4 @543 + ReaderKeysLockM = ReaderKeysLockM@8 @544 + ReaderKeysUnlock = ReaderKeysUnlock@4 @545 + ReaderKeysUnlockM = ReaderKeysUnlockM@8 @546 + ReaderList_Add = ReaderList_Add@20 @547 + ReaderList_Destroy = ReaderList_Destroy@4 @548 + ReaderList_GetFTDIDescriptionByIndex = ReaderList_GetFTDIDescriptionByIndex@8 @549 + ReaderList_GetFTDISerialByIndex = ReaderList_GetFTDISerialByIndex@8 @550 + ReaderList_GetInformation = ReaderList_GetInformation@44 @551 + ReaderList_GetSerialByIndex = ReaderList_GetSerialByIndex@8 @552 + ReaderList_GetSerialDescriptionByIndex = ReaderList_GetSerialDescriptionByIndex@8 @553 + ReaderList_GetTypeByIndex = ReaderList_GetTypeByIndex@8 @554 + ReaderList_OpenByIndex = ReaderList_OpenByIndex@8 @555 + ReaderList_OpenBySerial = ReaderList_OpenBySerial@8 @556 + ReaderList_UpdateAndGetCount = ReaderList_UpdateAndGetCount@4 @557 + ReaderOpen = ReaderOpen@0 @558 + ReaderOpenByType = ReaderOpenByType@4 @559 + ReaderOpenEx = ReaderOpenEx@16 @560 + ReaderOpenM = ReaderOpenM@4 @561 + ReaderOpen_uFROnline = ReaderOpen_uFROnline@4 @562 + ReaderReset = ReaderReset@0 @563 + ReaderResetM = ReaderResetM@4 @564 + ReaderResetWait = ReaderResetWait@0 @565 + ReaderRfOff = ReaderRfOff@0 @566 + ReaderRfOffM = ReaderRfOffM@4 @567 + ReaderRfOn = ReaderRfOn@0 @568 + ReaderRfOnM = ReaderRfOnM@4 @569 + ReaderRfReset = ReaderRfReset@0 @570 + ReaderRfResetM = ReaderRfResetM@4 @571 + ReaderSoftRestart = ReaderSoftRestart@0 @572 + ReaderSoftRestartM = ReaderSoftRestartM@4 @573 + ReaderSoundVolume = ReaderSoundVolume@4 @574 + ReaderSoundVolumeM = ReaderSoundVolumeM@8 @575 + ReaderStillConnected = ReaderStillConnected@4 @576 + ReaderStillConnectedM = ReaderStillConnectedM@8 @577 + ReaderUISignal = ReaderUISignal@8 @578 + ReaderUISignalM = ReaderUISignalM@12 @579 + RgbControl = RgbControl@12 @580 + RgbControlM = RgbControlM@16 @581 + RgbIdleDefault = RgbIdleDefault@0 @582 + RgbIdleDefaultM = RgbIdleDefaultM@4 @583 + RgbIdleSet = RgbIdleSet@12 @584 + RgbIdleSetM = RgbIdleSetM@16 @585 + RgbInternalTurnOff = RgbInternalTurnOff@0 @586 + RgbInternalTurnOffM = RgbInternalTurnOffM@4 @587 + RgbInternalTurnOn = RgbInternalTurnOn@0 @588 + RgbInternalTurnOnM = RgbInternalTurnOnM@4 @589 + SAM_authenticate_host_AV2_plain = SAM_authenticate_host_AV2_plain@16 @590 + SAM_authenticate_host_AV2_plainM = SAM_authenticate_host_AV2_plainM@20 @591 + SAM_authenticate_host_no_div_des = SAM_authenticate_host_no_div_des@12 @592 + SAM_authenticate_host_no_div_desM = SAM_authenticate_host_no_div_desM@16 @593 + SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key = SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key@24 @594 + SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_keyM = SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_keyM@28 @595 + SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key = SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key@24 @596 + SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_keyM = SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_keyM@28 @597 + SAM_change_key_entry_3K3DES_AV2_plain_one_key = SAM_change_key_entry_3K3DES_AV2_plain_one_key@24 @598 + SAM_change_key_entry_3K3DES_AV2_plain_one_keyM = SAM_change_key_entry_3K3DES_AV2_plain_one_keyM@28 @599 + SAM_change_key_entry_AES_AV2_plain_one_key = SAM_change_key_entry_AES_AV2_plain_one_key@24 @600 + SAM_change_key_entry_AES_AV2_plain_one_keyM = SAM_change_key_entry_AES_AV2_plain_one_keyM@28 @601 + SAM_change_key_entry_DES_AV2_plain_one_key = SAM_change_key_entry_DES_AV2_plain_one_key@24 @602 + SAM_change_key_entry_aes_AV2_plain_host_key = SAM_change_key_entry_aes_AV2_plain_host_key@52 @603 + SAM_change_key_entry_aes_AV2_plain_host_keyM = SAM_change_key_entry_aes_AV2_plain_host_keyM@56 @604 + SAM_change_key_entry_mifare_AV2_plain_one_key = SAM_change_key_entry_mifare_AV2_plain_one_key@28 @605 + SAM_change_key_entry_mifare_AV2_plain_one_keyM = SAM_change_key_entry_mifare_AV2_plain_one_keyM@32 @606 + SAM_get_key_entry_raw = SAM_get_key_entry_raw@16 @607 + SAM_get_key_entry_rawM = SAM_get_key_entry_rawM@20 @608 + SAM_get_version = SAM_get_version@8 @609 + SAM_get_versionM = SAM_get_versionM@12 @610 + SAM_get_version_raw = SAM_get_version_raw@8 @611 + SAM_get_version_rawM = SAM_get_version_rawM@12 @612 + SAM_pre_personalization_switch_to_AV2_mode = SAM_pre_personalization_switch_to_AV2_mode@12 @613 + SAM_pre_personalization_switch_to_AV2_modeM = SAM_pre_personalization_switch_to_AV2_modeM@16 @614 + SAM_pre_pesonalization_master_AES128_key = SAM_pre_pesonalization_master_AES128_key@28 @615 + SAM_pre_pesonalization_master_AES128_keyM = SAM_pre_pesonalization_master_AES128_keyM@32 @616 + SectorTrailerWrite = SectorTrailerWrite@44 @617 + SectorTrailerWriteM = SectorTrailerWriteM@48 @618 + SectorTrailerWriteSamKey = SectorTrailerWriteSamKey@44 @619 + SectorTrailerWriteSamKeyM = SectorTrailerWriteSamKeyM@48 @620 + SectorTrailerWriteUnsafe = SectorTrailerWriteUnsafe@20 @621 + SectorTrailerWriteUnsafeM = SectorTrailerWriteUnsafeM@24 @622 + SectorTrailerWriteUnsafe_AKM1 = SectorTrailerWriteUnsafe_AKM1@16 @623 + SectorTrailerWriteUnsafe_AKM1M = SectorTrailerWriteUnsafe_AKM1M@20 @624 + SectorTrailerWriteUnsafe_AKM2 = SectorTrailerWriteUnsafe_AKM2@16 @625 + SectorTrailerWriteUnsafe_AKM2M = SectorTrailerWriteUnsafe_AKM2M@20 @626 + SectorTrailerWriteUnsafe_PK = SectorTrailerWriteUnsafe_PK@20 @627 + SectorTrailerWriteUnsafe_PKM = SectorTrailerWriteUnsafe_PKM@24 @628 + SectorTrailerWrite_AKM1 = SectorTrailerWrite_AKM1@40 @629 + SectorTrailerWrite_AKM1M = SectorTrailerWrite_AKM1M@44 @630 + SectorTrailerWrite_AKM2 = SectorTrailerWrite_AKM2@40 @631 + SectorTrailerWrite_AKM2M = SectorTrailerWrite_AKM2M@44 @632 + SectorTrailerWrite_PK = SectorTrailerWrite_PK@44 @633 + SectorTrailerWrite_PKM = SectorTrailerWrite_PKM@48 @634 + SelectCard = SelectCard@12 @635 + SelectCardM = SelectCardM@16 @636 + SetATECC608DefaultKeysConfiguration = SetATECC608DefaultKeysConfiguration@0 @637 + SetATECC608DefaultKeysConfigurationM = SetATECC608DefaultKeysConfigurationM@4 @638 + SetATECC608DefaultSlotsConfiguration = SetATECC608DefaultSlotsConfiguration@0 @639 + SetATECC608DefaultSlotsConfigurationM = SetATECC608DefaultSlotsConfigurationM@4 @640 + SetATECC608ECCPrivateKey = SetATECC608ECCPrivateKey@20 @641 + SetATECC608ECCPrivateKeyM = SetATECC608ECCPrivateKeyM@24 @642 + SetATECC608ECCPrivateKeyUnencrypted = SetATECC608ECCPrivateKeyUnencrypted@20 @643 + SetATECC608ECCPrivateKeyUnencryptedM = SetATECC608ECCPrivateKeyUnencryptedM@24 @644 + SetATECC608IOSecretKey = SetATECC608IOSecretKey@0 @645 + SetATECC608IOSecretKeyM = SetATECC608IOSecretKeyM@4 @646 + SetAdHocEmulationParams = SetAdHocEmulationParams@20 @647 + SetAdHocEmulationParamsM = SetAdHocEmulationParamsM@24 @648 + SetAsyncCardIdSendConfig = SetAsyncCardIdSendConfig@24 @649 + SetAsyncCardIdSendConfigEx = SetAsyncCardIdSendConfigEx@32 @650 + SetAsyncCardIdSendConfigExM = SetAsyncCardIdSendConfigExM@36 @651 + SetAsyncCardIdSendConfigM = SetAsyncCardIdSendConfigM@28 @652 + SetCustomUiConfig = SetCustomUiConfig@20 @653 + SetCustomUiConfigM = SetCustomUiConfigM@24 @654 + SetDefaultUartSpeed = SetDefaultUartSpeed@12 @655 + SetDiscoveryLoop = SetDiscoveryLoop@8 @656 + SetDiscoveryLoopM = SetDiscoveryLoopM@12 @657 + SetDisplayData = SetDisplayData@8 @658 + SetDisplayDataM = SetDisplayDataM@12 @659 + SetDisplayIntensity = SetDisplayIntensity@4 @660 + SetDisplayIntensityM = SetDisplayIntensityM@8 @661 + SetISO14443_4_DLStorage = SetISO14443_4_DLStorage@0 @662 + SetISO14443_4_DLStorageM = SetISO14443_4_DLStorageM@4 @663 + SetISO14443_4_Mode = SetISO14443_4_Mode@0 @664 + SetISO14443_4_ModeM = SetISO14443_4_ModeM@4 @665 + SetISO14443_4_Mode_GetATS = SetISO14443_4_Mode_GetATS@20 @666 + SetISO14443_4_Mode_GetATSM = SetISO14443_4_Mode_GetATSM@24 @667 + SetLicenseData = SetLicenseData@4 @668 + SetMobileUniqueIdAid = SetMobileUniqueIdAid@8 @669 + SetMobileUniqueIdAidM = SetMobileUniqueIdAidM@12 @670 + SetReaderProMode = SetReaderProMode@4 @671 + SetReaderProModeM = SetReaderProModeM@8 @672 + SetReaderSerialDescription = SetReaderSerialDescription@4 @673 + SetReaderSerialDescriptionM = SetReaderSerialDescriptionM@8 @674 + SetReaderTime = SetReaderTime@8 @675 + SetReaderTimeM = SetReaderTimeM@12 @676 + SetRfAnalogRegistersISO14443_212 = SetRfAnalogRegistersISO14443_212@20 @677 + SetRfAnalogRegistersISO14443_212Default = SetRfAnalogRegistersISO14443_212Default@0 @678 + SetRfAnalogRegistersISO14443_212DefaultM = SetRfAnalogRegistersISO14443_212DefaultM@4 @679 + SetRfAnalogRegistersISO14443_212M = SetRfAnalogRegistersISO14443_212M@24 @680 + SetRfAnalogRegistersISO14443_424 = SetRfAnalogRegistersISO14443_424@20 @681 + SetRfAnalogRegistersISO14443_424Default = SetRfAnalogRegistersISO14443_424Default@0 @682 + SetRfAnalogRegistersISO14443_424DefaultM = SetRfAnalogRegistersISO14443_424DefaultM@4 @683 + SetRfAnalogRegistersISO14443_424M = SetRfAnalogRegistersISO14443_424M@24 @684 + SetRfAnalogRegistersTypeA = SetRfAnalogRegistersTypeA@20 @685 + SetRfAnalogRegistersTypeADefault = SetRfAnalogRegistersTypeADefault@0 @686 + SetRfAnalogRegistersTypeADefaultM = SetRfAnalogRegistersTypeADefaultM@4 @687 + SetRfAnalogRegistersTypeAM = SetRfAnalogRegistersTypeAM@24 @688 + SetRfAnalogRegistersTypeATrans = SetRfAnalogRegistersTypeATrans@40 @689 + SetRfAnalogRegistersTypeATransM = SetRfAnalogRegistersTypeATransM@44 @690 + SetRfAnalogRegistersTypeB = SetRfAnalogRegistersTypeB@20 @691 + SetRfAnalogRegistersTypeBDefault = SetRfAnalogRegistersTypeBDefault@0 @692 + SetRfAnalogRegistersTypeBDefaultM = SetRfAnalogRegistersTypeBDefaultM@4 @693 + SetRfAnalogRegistersTypeBM = SetRfAnalogRegistersTypeBM@24 @694 + SetRfAnalogRegistersTypeBTrans = SetRfAnalogRegistersTypeBTrans@36 @695 + SetRfAnalogRegistersTypeBTransM = SetRfAnalogRegistersTypeBTransM@40 @696 + SetRgbData = SetRgbData@12 @697 + SetRgbDataM = SetRgbDataM@16 @698 + SetRgbIntensity = SetRgbIntensity@4 @699 + SetRgbIntensityM = SetRgbIntensityM@8 @700 + SetServiceData = SetServiceData@4 @701 + SetServiceDataM = SetServiceDataM@8 @702 + SetSpeakerFrequency = SetSpeakerFrequency@4 @703 + SetSpeakerFrequencyM = SetSpeakerFrequencyM@8 @704 + SetSpeedPermanently = SetSpeedPermanently@8 @705 + SetSpeedPermanentlyM = SetSpeedPermanentlyM@12 @706 + SetUartSpeed = SetUartSpeed@4 @707 + StartAsyncSession = StartAsyncSession@8 @708 + StopAsyncSession = StopAsyncSession@0 @709 + SubscribeBlock = SubscribeBlock@8 @710 + SubscribeSector = SubscribeSector@8 @711 + TagEmulationMirrorCounterDisabled = TagEmulationMirrorCounterDisabled@0 @712 + TagEmulationMirrorCounterNonResetEnabled = TagEmulationMirrorCounterNonResetEnabled@4 @713 + TagEmulationMirrorCounterResetEnabled = TagEmulationMirrorCounterResetEnabled@4 @714 + TagEmulationStart = TagEmulationStart@0 @715 + TagEmulationStartM = TagEmulationStartM@4 @716 + TagEmulationStartRam = TagEmulationStartRam@0 @717 + TagEmulationStop = TagEmulationStop@0 @718 + TagEmulationStopM = TagEmulationStopM@4 @719 + TagEmulationStopRam = TagEmulationStopRam@0 @720 + UFR_DLCardType2String = UFR_DLCardType2String@4 @721 + UFR_SessionStatus2String = UFR_SessionStatus2String@4 @722 + UFR_Status2String = UFR_Status2String@4 @723 + ULC_ExternalAuth_PK = ULC_ExternalAuth_PK@4 @724 + ULC_ExternalAuth_PKM = ULC_ExternalAuth_PKM@8 @725 + ULC_write_3des_key = ULC_write_3des_key@8 @726 + ULC_write_3des_keyM = ULC_write_3des_keyM@12 @727 + ULC_write_3des_key_factory_key = ULC_write_3des_key_factory_key@4 @728 + ULC_write_3des_key_factory_keyM = ULC_write_3des_key_factory_keyM@8 @729 + ULC_write_3des_key_factory_key_internal = ULC_write_3des_key_factory_key_internal@4 @730 + ULC_write_3des_key_factory_key_internalM = ULC_write_3des_key_factory_key_internalM@8 @731 + ULC_write_3des_key_internal = ULC_write_3des_key_internal@8 @732 + ULC_write_3des_key_internalM = ULC_write_3des_key_internalM@12 @733 + ULC_write_3des_key_no_auth = ULC_write_3des_key_no_auth@4 @734 + ULC_write_3des_key_no_authM = ULC_write_3des_key_no_authM@8 @735 + ULC_write_3des_key_no_auth_internal = ULC_write_3des_key_no_auth_internal@4 @736 + ULC_write_3des_key_no_auth_internalM = ULC_write_3des_key_no_auth_internalM@8 @737 + UfrEnterSleepMode = UfrEnterSleepMode@0 @738 + UfrEnterSleepModeM = UfrEnterSleepModeM@4 @739 + UfrGetBadSelectCardNrMax = UfrGetBadSelectCardNrMax@4 @740 + UfrGetBadSelectCardNrMaxM = UfrGetBadSelectCardNrMaxM@8 @741 + UfrGetInputState = UfrGetInputState@8 @742 + UfrLeaveSleepMode = UfrLeaveSleepMode@0 @743 + UfrLeaveSleepModeM = UfrLeaveSleepModeM@4 @744 + UfrOutControl = UfrOutControl@20 @745 + UfrOutControlM = UfrOutControlM@24 @746 + UfrRedLightControl = UfrRedLightControl@4 @747 + UfrRedLightControlM = UfrRedLightControlM@8 @748 + UfrRgbExtLightControl = UfrRgbExtLightControl@4 @749 + UfrRgbExtLightControlM = UfrRgbExtLightControlM@8 @750 + UfrRgbLightControl = UfrRgbLightControl@20 @751 + UfrRgbLightControlM = UfrRgbLightControlM@24 @752 + UfrRgbLightControlRfPeriod = UfrRgbLightControlRfPeriod@32 @753 + UfrRgbLightControlRfPeriodM = UfrRgbLightControlRfPeriodM@36 @754 + UfrRgbLightControlSleep = UfrRgbLightControlSleep@28 @755 + UfrRgbLightControlSleepM = UfrRgbLightControlSleepM@32 @756 + UfrSetBadSelectCardNrMax = UfrSetBadSelectCardNrMax@4 @757 + UfrSetBadSelectCardNrMaxM = UfrSetBadSelectCardNrMaxM@8 @758 + UfrXrcGetIoState = UfrXrcGetIoState@12 @759 + UfrXrcGetIoStateM = UfrXrcGetIoStateM@16 @760 + UfrXrcLockOn = UfrXrcLockOn@4 @761 + UfrXrcLockOnM = UfrXrcLockOnM@8 @762 + UfrXrcRelayState = UfrXrcRelayState@4 @763 + UfrXrcRelayStateM = UfrXrcRelayStateM@8 @764 + ValueBlockDecrement = ValueBlockDecrement@16 @765 + ValueBlockDecrementM = ValueBlockDecrementM@20 @766 + ValueBlockDecrementSamKey = ValueBlockDecrementSamKey@16 @767 + ValueBlockDecrementSamKeyM = ValueBlockDecrementSamKeyM@20 @768 + ValueBlockDecrement_AKM1 = ValueBlockDecrement_AKM1@12 @769 + ValueBlockDecrement_AKM1M = ValueBlockDecrement_AKM1M@16 @770 + ValueBlockDecrement_AKM2 = ValueBlockDecrement_AKM2@12 @771 + ValueBlockDecrement_AKM2M = ValueBlockDecrement_AKM2M@16 @772 + ValueBlockDecrement_PK = ValueBlockDecrement_PK@16 @773 + ValueBlockDecrement_PKM = ValueBlockDecrement_PKM@20 @774 + ValueBlockInSectorDecrement = ValueBlockInSectorDecrement@20 @775 + ValueBlockInSectorDecrementM = ValueBlockInSectorDecrementM@24 @776 + ValueBlockInSectorDecrementSamKey = ValueBlockInSectorDecrementSamKey@20 @777 + ValueBlockInSectorDecrementSamKeyM = ValueBlockInSectorDecrementSamKeyM@24 @778 + ValueBlockInSectorDecrement_AKM1 = ValueBlockInSectorDecrement_AKM1@16 @779 + ValueBlockInSectorDecrement_AKM1M = ValueBlockInSectorDecrement_AKM1M@20 @780 + ValueBlockInSectorDecrement_AKM2 = ValueBlockInSectorDecrement_AKM2@16 @781 + ValueBlockInSectorDecrement_AKM2M = ValueBlockInSectorDecrement_AKM2M@20 @782 + ValueBlockInSectorDecrement_PK = ValueBlockInSectorDecrement_PK@20 @783 + ValueBlockInSectorDecrement_PKM = ValueBlockInSectorDecrement_PKM@24 @784 + ValueBlockInSectorIncrement = ValueBlockInSectorIncrement@20 @785 + ValueBlockInSectorIncrementM = ValueBlockInSectorIncrementM@24 @786 + ValueBlockInSectorIncrementSamKey = ValueBlockInSectorIncrementSamKey@20 @787 + ValueBlockInSectorIncrementSamKeyM = ValueBlockInSectorIncrementSamKeyM@24 @788 + ValueBlockInSectorIncrement_AKM1 = ValueBlockInSectorIncrement_AKM1@16 @789 + ValueBlockInSectorIncrement_AKM1M = ValueBlockInSectorIncrement_AKM1M@20 @790 + ValueBlockInSectorIncrement_AKM2 = ValueBlockInSectorIncrement_AKM2@16 @791 + ValueBlockInSectorIncrement_AKM2M = ValueBlockInSectorIncrement_AKM2M@20 @792 + ValueBlockInSectorIncrement_PK = ValueBlockInSectorIncrement_PK@20 @793 + ValueBlockInSectorIncrement_PKM = ValueBlockInSectorIncrement_PKM@24 @794 + ValueBlockInSectorRead = ValueBlockInSectorRead@24 @795 + ValueBlockInSectorReadM = ValueBlockInSectorReadM@28 @796 + ValueBlockInSectorReadSamKey = ValueBlockInSectorReadSamKey@24 @797 + ValueBlockInSectorReadSamKeyM = ValueBlockInSectorReadSamKeyM@28 @798 + ValueBlockInSectorRead_AKM1 = ValueBlockInSectorRead_AKM1@20 @799 + ValueBlockInSectorRead_AKM1M = ValueBlockInSectorRead_AKM1M@24 @800 + ValueBlockInSectorRead_AKM2 = ValueBlockInSectorRead_AKM2@20 @801 + ValueBlockInSectorRead_AKM2M = ValueBlockInSectorRead_AKM2M@24 @802 + ValueBlockInSectorRead_PK = ValueBlockInSectorRead_PK@24 @803 + ValueBlockInSectorRead_PKM = ValueBlockInSectorRead_PKM@28 @804 + ValueBlockInSectorWrite = ValueBlockInSectorWrite@24 @805 + ValueBlockInSectorWriteM = ValueBlockInSectorWriteM@28 @806 + ValueBlockInSectorWriteSamKey = ValueBlockInSectorWriteSamKey@24 @807 + ValueBlockInSectorWriteSamKeyM = ValueBlockInSectorWriteSamKeyM@28 @808 + ValueBlockInSectorWrite_AKM1 = ValueBlockInSectorWrite_AKM1@20 @809 + ValueBlockInSectorWrite_AKM1M = ValueBlockInSectorWrite_AKM1M@24 @810 + ValueBlockInSectorWrite_AKM2 = ValueBlockInSectorWrite_AKM2@20 @811 + ValueBlockInSectorWrite_AKM2M = ValueBlockInSectorWrite_AKM2M@24 @812 + ValueBlockInSectorWrite_PK = ValueBlockInSectorWrite_PK@24 @813 + ValueBlockInSectorWrite_PKM = ValueBlockInSectorWrite_PKM@28 @814 + ValueBlockIncrement = ValueBlockIncrement@16 @815 + ValueBlockIncrementM = ValueBlockIncrementM@20 @816 + ValueBlockIncrementSamKey = ValueBlockIncrementSamKey@16 @817 + ValueBlockIncrementSamKeyM = ValueBlockIncrementSamKeyM@20 @818 + ValueBlockIncrement_AKM1 = ValueBlockIncrement_AKM1@12 @819 + ValueBlockIncrement_AKM1M = ValueBlockIncrement_AKM1M@16 @820 + ValueBlockIncrement_AKM2 = ValueBlockIncrement_AKM2@12 @821 + ValueBlockIncrement_AKM2M = ValueBlockIncrement_AKM2M@16 @822 + ValueBlockIncrement_PK = ValueBlockIncrement_PK@16 @823 + ValueBlockIncrement_PKM = ValueBlockIncrement_PKM@20 @824 + ValueBlockRead = ValueBlockRead@20 @825 + ValueBlockReadM = ValueBlockReadM@24 @826 + ValueBlockReadSamKey = ValueBlockReadSamKey@20 @827 + ValueBlockReadSamKeyM = ValueBlockReadSamKeyM@24 @828 + ValueBlockRead_AKM1 = ValueBlockRead_AKM1@16 @829 + ValueBlockRead_AKM1M = ValueBlockRead_AKM1M@20 @830 + ValueBlockRead_AKM2 = ValueBlockRead_AKM2@16 @831 + ValueBlockRead_AKM2M = ValueBlockRead_AKM2M@20 @832 + ValueBlockRead_PK = ValueBlockRead_PK@20 @833 + ValueBlockRead_PKM = ValueBlockRead_PKM@24 @834 + ValueBlockWrite = ValueBlockWrite@20 @835 + ValueBlockWriteM = ValueBlockWriteM@24 @836 + ValueBlockWriteSamKey = ValueBlockWriteSamKey@20 @837 + ValueBlockWriteSamKeyM = ValueBlockWriteSamKeyM@24 @838 + ValueBlockWrite_AKM1 = ValueBlockWrite_AKM1@16 @839 + ValueBlockWrite_AKM1M = ValueBlockWrite_AKM1M@20 @840 + ValueBlockWrite_AKM2 = ValueBlockWrite_AKM2@16 @841 + ValueBlockWrite_AKM2M = ValueBlockWrite_AKM2M@20 @842 + ValueBlockWrite_PK = ValueBlockWrite_PK@20 @843 + ValueBlockWrite_PKM = ValueBlockWrite_PKM@24 @844 + WriteEmulationNdef = WriteEmulationNdef@28 @845 + WriteEmulationNdefM = WriteEmulationNdefM@32 @846 + WriteEmulationNdefRam = WriteEmulationNdefRam@28 @847 + WriteEmulationNdefRamM = WriteEmulationNdefRamM@32 @848 + WriteEmulationNdefWithAAR = WriteEmulationNdefWithAAR@36 @849 + WriteNdefRecord_Address = WriteNdefRecord_Address@8 @850 + WriteNdefRecord_AddressM = WriteNdefRecord_AddressM@12 @851 + WriteNdefRecord_AndroidApp = WriteNdefRecord_AndroidApp@8 @852 + WriteNdefRecord_AndroidAppM = WriteNdefRecord_AndroidAppM@12 @853 + WriteNdefRecord_BT = WriteNdefRecord_BT@8 @854 + WriteNdefRecord_BTM = WriteNdefRecord_BTM@12 @855 + WriteNdefRecord_Bitcoin = WriteNdefRecord_Bitcoin@16 @856 + WriteNdefRecord_BitcoinM = WriteNdefRecord_BitcoinM@20 @857 + WriteNdefRecord_Contact = WriteNdefRecord_Contact@28 @858 + WriteNdefRecord_ContactM = WriteNdefRecord_ContactM@32 @859 + WriteNdefRecord_Email = WriteNdefRecord_Email@16 @860 + WriteNdefRecord_EmailM = WriteNdefRecord_EmailM@20 @861 + WriteNdefRecord_GeoLocation = WriteNdefRecord_GeoLocation@12 @862 + WriteNdefRecord_GeoLocationM = WriteNdefRecord_GeoLocationM@16 @863 + WriteNdefRecord_NaviDestination = WriteNdefRecord_NaviDestination@8 @864 + WriteNdefRecord_NaviDestinationM = WriteNdefRecord_NaviDestinationM@12 @865 + WriteNdefRecord_Phone = WriteNdefRecord_Phone@8 @866 + WriteNdefRecord_PhoneM = WriteNdefRecord_PhoneM@12 @867 + WriteNdefRecord_SMS = WriteNdefRecord_SMS@12 @868 + WriteNdefRecord_SMSM = WriteNdefRecord_SMSM@16 @869 + WriteNdefRecord_Skype = WriteNdefRecord_Skype@12 @870 + WriteNdefRecord_SkypeM = WriteNdefRecord_SkypeM@16 @871 + WriteNdefRecord_StreetView = WriteNdefRecord_StreetView@12 @872 + WriteNdefRecord_StreetViewM = WriteNdefRecord_StreetViewM@16 @873 + WriteNdefRecord_Text = WriteNdefRecord_Text@8 @874 + WriteNdefRecord_TextM = WriteNdefRecord_TextM@12 @875 + WriteNdefRecord_Viber = WriteNdefRecord_Viber@8 @876 + WriteNdefRecord_ViberM = WriteNdefRecord_ViberM@12 @877 + WriteNdefRecord_Whatsapp = WriteNdefRecord_Whatsapp@8 @878 + WriteNdefRecord_WhatsappM = WriteNdefRecord_WhatsappM@12 @879 + WriteNdefRecord_WiFi = WriteNdefRecord_WiFi@20 @880 + WriteNdefRecord_WiFiM = WriteNdefRecord_WiFiM@24 @881 + WriteReaderId = WriteReaderId@4 @882 + WriteReaderIdM = WriteReaderIdM@8 @883 + WriteSamUnlockKey = WriteSamUnlockKey@12 @884 + WriteSamUnlockKeyM = WriteSamUnlockKeyM@16 @885 + WriteShareRam = WriteShareRam@12 @886 + WriteShareRamM = WriteShareRamM@16 @887 + WriteUserData = WriteUserData@4 @888 + WriteUserDataExt = WriteUserDataExt@4 @889 + WriteUserDataExtM = WriteUserDataExtM@8 @890 + WriteUserDataM = WriteUserDataM@8 @891 + ais_erase_right_record = ais_erase_right_record@4 @892 + ais_erase_right_recordM = ais_erase_right_recordM@8 @893 + ais_get_card_daily_duration = ais_get_card_daily_duration@4 @894 + ais_get_card_daily_durationM = ais_get_card_daily_durationM@8 @895 + ais_get_card_number = ais_get_card_number@4 @896 + ais_get_card_numberM = ais_get_card_numberM@8 @897 + ais_get_card_total_duration = ais_get_card_total_duration@4 @898 + ais_get_card_total_durationM = ais_get_card_total_durationM@8 @899 + ais_get_card_type = ais_get_card_type@4 @900 + ais_get_card_typeM = ais_get_card_typeM@8 @901 + ais_get_credit_and_period_validity = ais_get_credit_and_period_validity@44 @902 + ais_get_credit_and_period_validityM = ais_get_credit_and_period_validityM@48 @903 + ais_get_right_record = ais_get_right_record@32 @904 + ais_get_right_recordM = ais_get_right_recordM@36 @905 + ais_get_right_record_type_max_daily_counter = ais_get_right_record_type_max_daily_counter@36 @906 + ais_get_right_record_type_max_daily_counterM = ais_get_right_record_type_max_daily_counterM@40 @907 + ais_get_right_type_record = ais_get_right_type_record@12 @908 + ais_get_right_type_recordM = ais_get_right_type_recordM@16 @909 + ais_get_validate_record = ais_get_validate_record@40 @910 + ais_get_validate_recordM = ais_get_validate_recordM@44 @911 + ais_set_card_daily_duration = ais_set_card_daily_duration@4 @912 + ais_set_card_daily_durationM = ais_set_card_daily_durationM@8 @913 + ais_set_card_total_duration = ais_set_card_total_duration@4 @914 + ais_set_card_total_durationM = ais_set_card_total_durationM@8 @915 + ais_set_card_type = ais_set_card_type@4 @916 + ais_set_card_typeM = ais_set_card_typeM@8 @917 + ais_set_credit_and_period_validity = ais_set_credit_and_period_validity@44 @918 + ais_set_credit_and_period_validityM = ais_set_credit_and_period_validityM@48 @919 + ais_set_right_record = ais_set_right_record@32 @920 + ais_set_right_recordM = ais_set_right_recordM@36 @921 + ais_set_right_record_type_max_daily_counter = ais_set_right_record_type_max_daily_counter@36 @922 + ais_set_right_record_type_max_daily_counterM = ais_set_right_record_type_max_daily_counterM@40 @923 + ais_set_right_type_record = ais_set_right_type_record@12 @924 + ais_set_right_type_recordM = ais_set_right_type_recordM@16 @925 + ais_set_validate_record = ais_set_validate_record@40 @926 + ais_set_validate_recordM = ais_set_validate_recordM@44 @927 + card_halt_enable = card_halt_enable@0 @928 + card_halt_enableM = card_halt_enableM@4 @929 + card_transceive = card_transceive@40 @930 + card_transceiveM = card_transceiveM@44 @931 + card_transceive_mode_start = card_transceive_mode_start@16 @932 + card_transceive_mode_startM = card_transceive_mode_startM@20 @933 + card_transceive_mode_stop = card_transceive_mode_stop@0 @934 + card_transceive_mode_stopM = card_transceive_mode_stopM@4 @935 + close_ISO7816_interface_APDU_ISO14443_4 = close_ISO7816_interface_APDU_ISO14443_4@0 @936 + close_ISO7816_interface_APDU_ISO14443_4M = close_ISO7816_interface_APDU_ISO14443_4M@4 @937 + close_ISO7816_interface_no_APDU = close_ISO7816_interface_no_APDU@0 @938 + close_ISO7816_interface_no_APDUM = close_ISO7816_interface_no_APDUM@4 @939 + desfire_check_clear_record_transaction_mac = desfire_check_clear_record_transaction_mac@32 @940 + desfire_check_write_record_transaction_mac = desfire_check_write_record_transaction_mac@44 @941 + dfl_change_file_settings = dfl_change_file_settings@36 @942 + dfl_change_file_settingsM = dfl_change_file_settingsM@40 @943 + dfl_change_file_settings_pk = dfl_change_file_settings_pk@36 @944 + dfl_change_file_settings_pkM = dfl_change_file_settings_pkM@40 @945 + dfl_change_tmc_file_settings = dfl_change_tmc_file_settings@44 @946 + dfl_change_tmc_file_settingsM = dfl_change_tmc_file_settingsM@48 @947 + dfl_change_tmc_file_settings_pk = dfl_change_tmc_file_settings_pk@44 @948 + dfl_change_tmc_file_settings_pkM = dfl_change_tmc_file_settings_pkM@48 @949 + dfl_check_credit_value_transaction_mac = dfl_check_credit_value_transaction_mac@36 @950 + dfl_check_debit_value_transaction_mac = dfl_check_debit_value_transaction_mac@36 @951 + dfl_check_write_record_transaction_mac = dfl_check_write_record_transaction_mac@44 @952 + dfl_delete_tmc_file = dfl_delete_tmc_file@8 @953 + dfl_delete_tmc_fileM = dfl_delete_tmc_fileM@12 @954 + dfl_delete_tmc_file_pk = dfl_delete_tmc_file_pk@8 @955 + dfl_delete_tmc_file_pkM = dfl_delete_tmc_file_pkM@12 @956 + dfl_get_file_settings = dfl_get_file_settings@84 @957 + erase_all_ndef_records = erase_all_ndef_records@4 @958 + erase_all_ndef_recordsM = erase_all_ndef_recordsM@8 @959 + erase_last_ndef_record = erase_last_ndef_record@4 @960 + erase_last_ndef_recordM = erase_last_ndef_recordM@8 @961 + get_ndef_record_count = get_ndef_record_count@16 @962 + get_ndef_record_countM = get_ndef_record_countM@20 @963 + i_block_trans_rcv_chain = i_block_trans_rcv_chain@32 @964 + i_block_trans_rcv_chainM = i_block_trans_rcv_chainM@36 @965 + ndef_card_initialization = ndef_card_initialization@0 @966 + ndef_card_initializationM = ndef_card_initializationM@4 @967 + nt4h_change_key = nt4h_change_key@16 @968 + nt4h_change_keyM = nt4h_change_keyM@20 @969 + nt4h_change_key_pk = nt4h_change_key_pk@16 @970 + nt4h_change_key_pkM = nt4h_change_key_pkM@20 @971 + nt4h_change_sdm_file_settings = nt4h_change_sdm_file_settings@96 @972 + nt4h_change_sdm_file_settingsM = nt4h_change_sdm_file_settingsM@100 @973 + nt4h_change_sdm_file_settings_pk = nt4h_change_sdm_file_settings_pk@96 @974 + nt4h_change_sdm_file_settings_pkM = nt4h_change_sdm_file_settings_pkM@100 @975 + nt4h_change_standard_file_settings = nt4h_change_standard_file_settings@36 @976 + nt4h_change_standard_file_settingsM = nt4h_change_standard_file_settingsM@40 @977 + nt4h_change_standard_file_settings_pk = nt4h_change_standard_file_settings_pk@36 @978 + nt4h_change_standard_file_settings_pkM = nt4h_change_standard_file_settings_pkM@40 @979 + nt4h_check_sdm_mac = nt4h_check_sdm_mac@24 @980 + nt4h_decrypt_picc_data = nt4h_decrypt_picc_data@20 @981 + nt4h_decrypt_sdm_enc_file_data = nt4h_decrypt_sdm_enc_file_data@20 @982 + nt4h_enable_tt = nt4h_enable_tt@8 @983 + nt4h_enable_ttM = nt4h_enable_ttM@12 @984 + nt4h_enable_tt_pk = nt4h_enable_tt_pk@8 @985 + nt4h_enable_tt_pkM = nt4h_enable_tt_pkM@12 @986 + nt4h_get_file_settings = nt4h_get_file_settings@96 @987 + nt4h_get_file_settingsM = nt4h_get_file_settingsM@100 @988 + nt4h_get_sdm_ctr = nt4h_get_sdm_ctr@16 @989 + nt4h_get_sdm_ctrM = nt4h_get_sdm_ctrM@20 @990 + nt4h_get_sdm_ctr_no_auth = nt4h_get_sdm_ctr_no_auth@8 @991 + nt4h_get_sdm_ctr_no_authM = nt4h_get_sdm_ctr_no_authM@12 @992 + nt4h_get_sdm_ctr_pk = nt4h_get_sdm_ctr_pk@16 @993 + nt4h_get_sdm_ctr_pkM = nt4h_get_sdm_ctr_pkM@20 @994 + nt4h_get_tt_status = nt4h_get_tt_status@16 @995 + nt4h_get_tt_statusM = nt4h_get_tt_statusM@20 @996 + nt4h_get_tt_status_no_auth = nt4h_get_tt_status_no_auth@8 @997 + nt4h_get_tt_status_no_authM = nt4h_get_tt_status_no_authM@12 @998 + nt4h_get_tt_status_pk = nt4h_get_tt_status_pk@16 @999 + nt4h_get_tt_status_pkM = nt4h_get_tt_status_pkM@20 @1000 + nt4h_get_uid = nt4h_get_uid@12 @1001 + nt4h_get_uidM = nt4h_get_uidM@16 @1002 + nt4h_get_uid_pk = nt4h_get_uid_pk@12 @1003 + nt4h_get_uid_pkM = nt4h_get_uid_pkM@16 @1004 + nt4h_rid_read_ecc_signature = nt4h_rid_read_ecc_signature@20 @1005 + nt4h_rid_read_ecc_signatureM = nt4h_rid_read_ecc_signatureM@24 @1006 + nt4h_rid_read_ecc_signature_pk = nt4h_rid_read_ecc_signature_pk@20 @1007 + nt4h_rid_read_ecc_signature_pkM = nt4h_rid_read_ecc_signature_pkM@24 @1008 + nt4h_set_global_parameters = nt4h_set_global_parameters@12 @1009 + nt4h_set_global_parametersM = nt4h_set_global_parametersM@16 @1010 + nt4h_set_rid = nt4h_set_rid@4 @1011 + nt4h_set_ridM = nt4h_set_ridM@8 @1012 + nt4h_set_rid_pk = nt4h_set_rid_pk@4 @1013 + nt4h_set_rid_pkM = nt4h_set_rid_pkM@8 @1014 + nt4h_tt_change_sdm_file_settings = nt4h_tt_change_sdm_file_settings@104 @1015 + nt4h_tt_change_sdm_file_settingsM = nt4h_tt_change_sdm_file_settingsM@108 @1016 + nt4h_tt_change_sdm_file_settings_pk = nt4h_tt_change_sdm_file_settings_pk@104 @1017 + nt4h_tt_change_sdm_file_settings_pkM = nt4h_tt_change_sdm_file_settings_pkM@108 @1018 + nt4h_tt_get_file_settings = nt4h_tt_get_file_settings@104 @1019 + nt4h_tt_get_file_settingsM = nt4h_tt_get_file_settingsM@108 @1020 + nt4h_unset_rid_pk = nt4h_unset_rid_pk@4 @1021 + open_ISO7816_interface = open_ISO7816_interface@8 @1022 + open_ISO7816_interfaceM = open_ISO7816_interfaceM@12 @1023 + r_block_transceive = r_block_transceive@24 @1024 + r_block_transceiveM = r_block_transceiveM@28 @1025 + read_ndef_record = read_ndef_record@36 @1026 + read_ndef_recordM = read_ndef_recordM@40 @1027 + s_block_deselect = s_block_deselect@4 @1028 + s_block_deselectM = s_block_deselectM@8 @1029 + setCardDetectedCallback = setCardDetectedCallback@4 @1030 + setCardRemovedCallback = setCardRemovedCallback@4 @1031 + setSessionErrorCallback = setSessionErrorCallback@4 @1032 + test_desfire_ver = test_desfire_ver@0 @1033 + test_i_block = test_i_block@0 @1034 + uFR_APDU_Start = uFR_APDU_Start@0 @1035 + uFR_APDU_StartM = uFR_APDU_StartM@4 @1036 + uFR_APDU_Stop = uFR_APDU_Stop@0 @1037 + uFR_APDU_StopM = uFR_APDU_StopM@4 @1038 + uFR_APDU_Transceive = uFR_APDU_Transceive@44 @1039 + uFR_APDU_TransceiveM = uFR_APDU_TransceiveM@48 @1040 + uFR_DESFIRE_Start = uFR_DESFIRE_Start@0 @1041 + uFR_DESFIRE_StartM = uFR_DESFIRE_StartM@4 @1042 + uFR_DESFIRE_Stop = uFR_DESFIRE_Stop@0 @1043 + uFR_DESFIRE_StopM = uFR_DESFIRE_StopM@4 @1044 + uFR_SAM_DesfireChange2k3desKey_2k3desAuth = uFR_SAM_DesfireChange2k3desKey_2k3desAuth@32 @1045 + uFR_SAM_DesfireChange2k3desKey_2k3desAuthM = uFR_SAM_DesfireChange2k3desKey_2k3desAuthM@36 @1046 + uFR_SAM_DesfireChange2k3desKey_DesAuth = uFR_SAM_DesfireChange2k3desKey_DesAuth@32 @1047 + uFR_SAM_DesfireChange2k3desKey_DesAuthM = uFR_SAM_DesfireChange2k3desKey_DesAuthM@36 @1048 + uFR_SAM_DesfireChange3k3desKey_3k3desAuth = uFR_SAM_DesfireChange3k3desKey_3k3desAuth@32 @1049 + uFR_SAM_DesfireChange3k3desKey_3k3desAuthM = uFR_SAM_DesfireChange3k3desKey_3k3desAuthM@36 @1050 + uFR_SAM_DesfireChangeAesKey_AesAuth = uFR_SAM_DesfireChangeAesKey_AesAuth@32 @1051 + uFR_SAM_DesfireChangeDesKey_2k3desAuth = uFR_SAM_DesfireChangeDesKey_2k3desAuth@32 @1052 + uFR_SAM_DesfireChangeDesKey_2k3desAuthM = uFR_SAM_DesfireChangeDesKey_2k3desAuthM@36 @1053 + uFR_SAM_DesfireChangeDesKey_DesAuth = uFR_SAM_DesfireChangeDesKey_DesAuth@32 @1054 + uFR_SAM_DesfireChangeDesKey_DesAuthM = uFR_SAM_DesfireChangeDesKey_DesAuthM@36 @1055 + uFR_SAM_DesfireChangeFileSettings2k3desAuth = uFR_SAM_DesfireChangeFileSettings2k3desAuth@40 @1056 + uFR_SAM_DesfireChangeFileSettings2k3desAuthM = uFR_SAM_DesfireChangeFileSettings2k3desAuthM@44 @1057 + uFR_SAM_DesfireChangeFileSettings3k3desAuth = uFR_SAM_DesfireChangeFileSettings3k3desAuth@40 @1058 + uFR_SAM_DesfireChangeFileSettings3k3desAuthM = uFR_SAM_DesfireChangeFileSettings3k3desAuthM@44 @1059 + uFR_SAM_DesfireChangeFileSettingsAesAuth = uFR_SAM_DesfireChangeFileSettingsAesAuth@40 @1060 + uFR_SAM_DesfireChangeFileSettingsAesAuthM = uFR_SAM_DesfireChangeFileSettingsAesAuthM@44 @1061 + uFR_SAM_DesfireChangeFileSettingsDesAuth = uFR_SAM_DesfireChangeFileSettingsDesAuth@40 @1062 + uFR_SAM_DesfireChangeFileSettingsDesAuthM = uFR_SAM_DesfireChangeFileSettingsDesAuthM@44 @1063 + uFR_SAM_DesfireChangeFileSettingsSdm = uFR_SAM_DesfireChangeFileSettingsSdm@100 @1064 + uFR_SAM_DesfireChangeFileSettingsSdmM = uFR_SAM_DesfireChangeFileSettingsSdmM@104 @1065 + uFR_SAM_DesfireChangeKeySettings2k3desAuth = uFR_SAM_DesfireChangeKeySettings2k3desAuth@20 @1066 + uFR_SAM_DesfireChangeKeySettings2k3desAuthM = uFR_SAM_DesfireChangeKeySettings2k3desAuthM@24 @1067 + uFR_SAM_DesfireChangeKeySettings3k3desAuth = uFR_SAM_DesfireChangeKeySettings3k3desAuth@20 @1068 + uFR_SAM_DesfireChangeKeySettings3k3desAuthM = uFR_SAM_DesfireChangeKeySettings3k3desAuthM@24 @1069 + uFR_SAM_DesfireChangeKeySettingsAesAuth = uFR_SAM_DesfireChangeKeySettingsAesAuth@20 @1070 + uFR_SAM_DesfireChangeKeySettingsAesAuthM = uFR_SAM_DesfireChangeKeySettingsAesAuthM@24 @1071 + uFR_SAM_DesfireChangeKeySettingsDesAuth = uFR_SAM_DesfireChangeKeySettingsDesAuth@20 @1072 + uFR_SAM_DesfireChangeKeySettingsDesAuthM = uFR_SAM_DesfireChangeKeySettingsDesAuthM@24 @1073 + uFR_SAM_DesfireChangeKey_AesAuthM = uFR_SAM_DesfireChangeKey_AesAuthM@36 @1074 + uFR_SAM_DesfireChangeMasterKey = uFR_SAM_DesfireChangeMasterKey@24 @1075 + uFR_SAM_DesfireChangeMasterKeyM = uFR_SAM_DesfireChangeMasterKeyM@28 @1076 + uFR_SAM_DesfireClearRecordFile2k3desAuth = uFR_SAM_DesfireClearRecordFile2k3desAuth@20 @1077 + uFR_SAM_DesfireClearRecordFile2k3desAuth_2 = uFR_SAM_DesfireClearRecordFile2k3desAuth_2@24 @1078 + uFR_SAM_DesfireClearRecordFile2k3desAuth_2M = uFR_SAM_DesfireClearRecordFile2k3desAuth_2M@28 @1079 + uFR_SAM_DesfireClearRecordFile3k3desAuth = uFR_SAM_DesfireClearRecordFile3k3desAuth@20 @1080 + uFR_SAM_DesfireClearRecordFile3k3desAuthM = uFR_SAM_DesfireClearRecordFile3k3desAuthM@24 @1081 + uFR_SAM_DesfireClearRecordFile3k3desAuth_2 = uFR_SAM_DesfireClearRecordFile3k3desAuth_2@24 @1082 + uFR_SAM_DesfireClearRecordFile3k3desAuth_2M = uFR_SAM_DesfireClearRecordFile3k3desAuth_2M@28 @1083 + uFR_SAM_DesfireClearRecordFileAesAuth = uFR_SAM_DesfireClearRecordFileAesAuth@20 @1084 + uFR_SAM_DesfireClearRecordFileAesAuthM = uFR_SAM_DesfireClearRecordFileAesAuthM@24 @1085 + uFR_SAM_DesfireClearRecordFileAesAuth_2 = uFR_SAM_DesfireClearRecordFileAesAuth_2@24 @1086 + uFR_SAM_DesfireClearRecordFileAesAuth_2M = uFR_SAM_DesfireClearRecordFileAesAuth_2M@28 @1087 + uFR_SAM_DesfireClearRecordFileDesAuth = uFR_SAM_DesfireClearRecordFileDesAuth@20 @1088 + uFR_SAM_DesfireClearRecordFileDesAuth_2 = uFR_SAM_DesfireClearRecordFileDesAuth_2@24 @1089 + uFR_SAM_DesfireClearRecordFileDesAuth_2M = uFR_SAM_DesfireClearRecordFileDesAuth_2M@28 @1090 + uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuth = uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuth@44 @1091 + uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM = uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM@48 @1092 + uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuth = uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuth@44 @1093 + uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM = uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM@48 @1094 + uFR_SAM_DesfireClearRecordFile_TransMac_AesAuth = uFR_SAM_DesfireClearRecordFile_TransMac_AesAuth@44 @1095 + uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM = uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM@48 @1096 + uFR_SAM_DesfireClearRecordFile_TransMac_DesAuth = uFR_SAM_DesfireClearRecordFile_TransMac_DesAuth@44 @1097 + uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM = uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM@48 @1098 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuth = uFR_SAM_DesfireCreate3k3desApplication2k3desAuth@24 @1099 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIso = uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIso@36 @1100 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM = uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM@40 @1101 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM = uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM@28 @1102 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuth = uFR_SAM_DesfireCreate3k3desApplication3k3desAuth@24 @1103 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIso = uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIso@36 @1104 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM = uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM@40 @1105 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM = uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM@28 @1106 + uFR_SAM_DesfireCreate3k3desApplicationAesAuth = uFR_SAM_DesfireCreate3k3desApplicationAesAuth@24 @1107 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthIso = uFR_SAM_DesfireCreate3k3desApplicationAesAuthIso@36 @1108 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM = uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM@40 @1109 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthM = uFR_SAM_DesfireCreate3k3desApplicationAesAuthM@28 @1110 + uFR_SAM_DesfireCreate3k3desApplicationDesAuth = uFR_SAM_DesfireCreate3k3desApplicationDesAuth@24 @1111 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthIso = uFR_SAM_DesfireCreate3k3desApplicationDesAuthIso@36 @1112 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM = uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM@40 @1113 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthM = uFR_SAM_DesfireCreate3k3desApplicationDesAuthM@28 @1114 + uFR_SAM_DesfireCreateAesApplication2k3desAuth = uFR_SAM_DesfireCreateAesApplication2k3desAuth@24 @1115 + uFR_SAM_DesfireCreateAesApplication2k3desAuthIso = uFR_SAM_DesfireCreateAesApplication2k3desAuthIso@36 @1116 + uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM = uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM@40 @1117 + uFR_SAM_DesfireCreateAesApplication2k3desAuthM = uFR_SAM_DesfireCreateAesApplication2k3desAuthM@28 @1118 + uFR_SAM_DesfireCreateAesApplication3k3desAuth = uFR_SAM_DesfireCreateAesApplication3k3desAuth@24 @1119 + uFR_SAM_DesfireCreateAesApplication3k3desAuthIso = uFR_SAM_DesfireCreateAesApplication3k3desAuthIso@36 @1120 + uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM = uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM@40 @1121 + uFR_SAM_DesfireCreateAesApplication3k3desAuthM = uFR_SAM_DesfireCreateAesApplication3k3desAuthM@28 @1122 + uFR_SAM_DesfireCreateAesApplicationAesAuth = uFR_SAM_DesfireCreateAesApplicationAesAuth@24 @1123 + uFR_SAM_DesfireCreateAesApplicationAesAuthIso = uFR_SAM_DesfireCreateAesApplicationAesAuthIso@36 @1124 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscd = uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscd@36 @1125 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM = uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM@40 @1126 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM = uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM@40 @1127 + uFR_SAM_DesfireCreateAesApplicationAesAuthM = uFR_SAM_DesfireCreateAesApplicationAesAuthM@28 @1128 + uFR_SAM_DesfireCreateAesApplicationDesAuth = uFR_SAM_DesfireCreateAesApplicationDesAuth@24 @1129 + uFR_SAM_DesfireCreateAesApplicationDesAuthIso = uFR_SAM_DesfireCreateAesApplicationDesAuthIso@36 @1130 + uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM = uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM@40 @1131 + uFR_SAM_DesfireCreateAesApplicationDesAuthM = uFR_SAM_DesfireCreateAesApplicationDesAuthM@28 @1132 + uFR_SAM_DesfireCreateBackupDataFile2k3desAuth = uFR_SAM_DesfireCreateBackupDataFile2k3desAuth@44 @1133 + uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM = uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM@48 @1134 + uFR_SAM_DesfireCreateBackupDataFile3k3desAuth = uFR_SAM_DesfireCreateBackupDataFile3k3desAuth@44 @1135 + uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM = uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM@48 @1136 + uFR_SAM_DesfireCreateBackupDataFileAesAuth = uFR_SAM_DesfireCreateBackupDataFileAesAuth@44 @1137 + uFR_SAM_DesfireCreateBackupDataFileAesAuthM = uFR_SAM_DesfireCreateBackupDataFileAesAuthM@48 @1138 + uFR_SAM_DesfireCreateBackupDataFileDesAuth = uFR_SAM_DesfireCreateBackupDataFileDesAuth@44 @1139 + uFR_SAM_DesfireCreateBackupdDataFileDesAuthM = uFR_SAM_DesfireCreateBackupdDataFileDesAuthM@48 @1140 + uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuth = uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuth@48 @1141 + uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM = uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM@52 @1142 + uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuth = uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuth@48 @1143 + uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM = uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM@52 @1144 + uFR_SAM_DesfireCreateCyclicRecordFileAesAuth = uFR_SAM_DesfireCreateCyclicRecordFileAesAuth@48 @1145 + uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM = uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM@52 @1146 + uFR_SAM_DesfireCreateCyclicRecordFileDesAuth = uFR_SAM_DesfireCreateCyclicRecordFileDesAuth@48 @1147 + uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM = uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM@52 @1148 + uFR_SAM_DesfireCreateDesApplication2k3desAuth = uFR_SAM_DesfireCreateDesApplication2k3desAuth@24 @1149 + uFR_SAM_DesfireCreateDesApplication2k3desAuthIso = uFR_SAM_DesfireCreateDesApplication2k3desAuthIso@36 @1150 + uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM = uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM@40 @1151 + uFR_SAM_DesfireCreateDesApplication2k3desAuthM = uFR_SAM_DesfireCreateDesApplication2k3desAuthM@28 @1152 + uFR_SAM_DesfireCreateDesApplication3k3desAuth = uFR_SAM_DesfireCreateDesApplication3k3desAuth@24 @1153 + uFR_SAM_DesfireCreateDesApplication3k3desAuthIso = uFR_SAM_DesfireCreateDesApplication3k3desAuthIso@36 @1154 + uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM = uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM@40 @1155 + uFR_SAM_DesfireCreateDesApplication3k3desAuthM = uFR_SAM_DesfireCreateDesApplication3k3desAuthM@28 @1156 + uFR_SAM_DesfireCreateDesApplicationAesAuth = uFR_SAM_DesfireCreateDesApplicationAesAuth@24 @1157 + uFR_SAM_DesfireCreateDesApplicationAesAuthIso = uFR_SAM_DesfireCreateDesApplicationAesAuthIso@36 @1158 + uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM = uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM@40 @1159 + uFR_SAM_DesfireCreateDesApplicationAesAuthM = uFR_SAM_DesfireCreateDesApplicationAesAuthM@28 @1160 + uFR_SAM_DesfireCreateDesApplicationDesAuth = uFR_SAM_DesfireCreateDesApplicationDesAuth@24 @1161 + uFR_SAM_DesfireCreateDesApplicationDesAuthIso = uFR_SAM_DesfireCreateDesApplicationDesAuthIso@36 @1162 + uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM = uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM@40 @1163 + uFR_SAM_DesfireCreateDesApplicationDesAuthM = uFR_SAM_DesfireCreateDesApplicationDesAuthM@28 @1164 + uFR_SAM_DesfireCreateLinearRecordFile2k3desAuth = uFR_SAM_DesfireCreateLinearRecordFile2k3desAuth@48 @1165 + uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM = uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM@52 @1166 + uFR_SAM_DesfireCreateLinearRecordFile3k3desAuth = uFR_SAM_DesfireCreateLinearRecordFile3k3desAuth@48 @1167 + uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM = uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM@52 @1168 + uFR_SAM_DesfireCreateLinearRecordFileAesAuth = uFR_SAM_DesfireCreateLinearRecordFileAesAuth@48 @1169 + uFR_SAM_DesfireCreateLinearRecordFileAesAuthM = uFR_SAM_DesfireCreateLinearRecordFileAesAuthM@52 @1170 + uFR_SAM_DesfireCreateLinearRecordFileDesAuth = uFR_SAM_DesfireCreateLinearRecordFileDesAuth@48 @1171 + uFR_SAM_DesfireCreateLinearRecordFileDesAuthM = uFR_SAM_DesfireCreateLinearRecordFileDesAuthM@52 @1172 + uFR_SAM_DesfireCreateStdDataFile2k3desAuth = uFR_SAM_DesfireCreateStdDataFile2k3desAuth@44 @1173 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthIso = uFR_SAM_DesfireCreateStdDataFile2k3desAuthIso@48 @1174 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM = uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM@52 @1175 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthM = uFR_SAM_DesfireCreateStdDataFile2k3desAuthM@48 @1176 + uFR_SAM_DesfireCreateStdDataFile3k3desAuth = uFR_SAM_DesfireCreateStdDataFile3k3desAuth@44 @1177 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthIso = uFR_SAM_DesfireCreateStdDataFile3k3desAuthIso@48 @1178 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM = uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM@52 @1179 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthM = uFR_SAM_DesfireCreateStdDataFile3k3desAuthM@48 @1180 + uFR_SAM_DesfireCreateStdDataFileAesAuth = uFR_SAM_DesfireCreateStdDataFileAesAuth@44 @1181 + uFR_SAM_DesfireCreateStdDataFileAesAuthIso = uFR_SAM_DesfireCreateStdDataFileAesAuthIso@48 @1182 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM = uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM@52 @1183 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdm = uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdm@48 @1184 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM = uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM@52 @1185 + uFR_SAM_DesfireCreateStdDataFileAesAuthM = uFR_SAM_DesfireCreateStdDataFileAesAuthM@48 @1186 + uFR_SAM_DesfireCreateStdDataFileDesAuth = uFR_SAM_DesfireCreateStdDataFileDesAuth@44 @1187 + uFR_SAM_DesfireCreateStdDataFileDesAuthIso = uFR_SAM_DesfireCreateStdDataFileDesAuthIso@48 @1188 + uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM = uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM@52 @1189 + uFR_SAM_DesfireCreateStdDataFileDesAuthM = uFR_SAM_DesfireCreateStdDataFileDesAuthM@48 @1190 + uFR_SAM_DesfireCreateTransMacFile2k3desAuth = uFR_SAM_DesfireCreateTransMacFile2k3desAuth@40 @1191 + uFR_SAM_DesfireCreateTransMacFile2k3desAuthM = uFR_SAM_DesfireCreateTransMacFile2k3desAuthM@44 @1192 + uFR_SAM_DesfireCreateTransMacFile3k3desAuth = uFR_SAM_DesfireCreateTransMacFile3k3desAuth@40 @1193 + uFR_SAM_DesfireCreateTransMacFile3k3desAuthM = uFR_SAM_DesfireCreateTransMacFile3k3desAuthM@44 @1194 + uFR_SAM_DesfireCreateTransMacFileAesAuth = uFR_SAM_DesfireCreateTransMacFileAesAuth@40 @1195 + uFR_SAM_DesfireCreateTransMacFileAesAuthM = uFR_SAM_DesfireCreateTransMacFileAesAuthM@44 @1196 + uFR_SAM_DesfireCreateTransMacFileDesAuth = uFR_SAM_DesfireCreateTransMacFileDesAuth@40 @1197 + uFR_SAM_DesfireCreateTransMacFileDesAuthM = uFR_SAM_DesfireCreateTransMacFileDesAuthM@44 @1198 + uFR_SAM_DesfireCreateValueFile2k3desAuth = uFR_SAM_DesfireCreateValueFile2k3desAuth@56 @1199 + uFR_SAM_DesfireCreateValueFile2k3desAuthM = uFR_SAM_DesfireCreateValueFile2k3desAuthM@60 @1200 + uFR_SAM_DesfireCreateValueFile3k3desAuth = uFR_SAM_DesfireCreateValueFile3k3desAuth@56 @1201 + uFR_SAM_DesfireCreateValueFile3k3desAuthM = uFR_SAM_DesfireCreateValueFile3k3desAuthM@60 @1202 + uFR_SAM_DesfireCreateValueFileAesAuth = uFR_SAM_DesfireCreateValueFileAesAuth@56 @1203 + uFR_SAM_DesfireCreateValueFileAesAuthM = uFR_SAM_DesfireCreateValueFileAesAuthM@60 @1204 + uFR_SAM_DesfireCreateValueFileDesAuth = uFR_SAM_DesfireCreateValueFileDesAuth@56 @1205 + uFR_SAM_DesfireCreateValueFileDesAuthM = uFR_SAM_DesfireCreateValueFileDesAuthM@60 @1206 + uFR_SAM_DesfireDecreaseValueFile2k3desAuth = uFR_SAM_DesfireDecreaseValueFile2k3desAuth@32 @1207 + uFR_SAM_DesfireDecreaseValueFile2k3desAuthM = uFR_SAM_DesfireDecreaseValueFile2k3desAuthM@36 @1208 + uFR_SAM_DesfireDecreaseValueFile3k3desAuth = uFR_SAM_DesfireDecreaseValueFile3k3desAuth@32 @1209 + uFR_SAM_DesfireDecreaseValueFile3k3desAuthM = uFR_SAM_DesfireDecreaseValueFile3k3desAuthM@36 @1210 + uFR_SAM_DesfireDecreaseValueFileAesAuth = uFR_SAM_DesfireDecreaseValueFileAesAuth@32 @1211 + uFR_SAM_DesfireDecreaseValueFileAesAuthM = uFR_SAM_DesfireDecreaseValueFileAesAuthM@36 @1212 + uFR_SAM_DesfireDecreaseValueFileDesAuth = uFR_SAM_DesfireDecreaseValueFileDesAuth@32 @1213 + uFR_SAM_DesfireDecreaseValueFileDesAuthM = uFR_SAM_DesfireDecreaseValueFileDesAuthM@36 @1214 + uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuth = uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuth@52 @1215 + uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM = uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM@56 @1216 + uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuth = uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuth@52 @1217 + uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM = uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM@56 @1218 + uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuth = uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuth@52 @1219 + uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM = uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM@56 @1220 + uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuth = uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuth@52 @1221 + uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM = uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM@56 @1222 + uFR_SAM_DesfireDeleteApplication2k3desAuth = uFR_SAM_DesfireDeleteApplication2k3desAuth@16 @1223 + uFR_SAM_DesfireDeleteApplication2k3desAuthM = uFR_SAM_DesfireDeleteApplication2k3desAuthM@20 @1224 + uFR_SAM_DesfireDeleteApplication3k3desAuth = uFR_SAM_DesfireDeleteApplication3k3desAuth@16 @1225 + uFR_SAM_DesfireDeleteApplication3k3desAuthM = uFR_SAM_DesfireDeleteApplication3k3desAuthM@20 @1226 + uFR_SAM_DesfireDeleteApplicationAesAuth = uFR_SAM_DesfireDeleteApplicationAesAuth@16 @1227 + uFR_SAM_DesfireDeleteApplicationAesAuthM = uFR_SAM_DesfireDeleteApplicationAesAuthM@20 @1228 + uFR_SAM_DesfireDeleteApplicationDesAuth = uFR_SAM_DesfireDeleteApplicationDesAuth@16 @1229 + uFR_SAM_DesfireDeleteApplicationDesAuthM = uFR_SAM_DesfireDeleteApplicationDesAuthM@20 @1230 + uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuth = uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuth@16 @1231 + uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM = uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM@20 @1232 + uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuth = uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuth@16 @1233 + uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM = uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM@20 @1234 + uFR_SAM_DesfireDeleteApplication_app_master_AesAuth = uFR_SAM_DesfireDeleteApplication_app_master_AesAuth@16 @1235 + uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM = uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM@20 @1236 + uFR_SAM_DesfireDeleteApplication_app_master_DesAuth = uFR_SAM_DesfireDeleteApplication_app_master_DesAuth@16 @1237 + uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM = uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM@20 @1238 + uFR_SAM_DesfireDeleteFile2k3desAuth = uFR_SAM_DesfireDeleteFile2k3desAuth@20 @1239 + uFR_SAM_DesfireDeleteFile2k3desAuthM = uFR_SAM_DesfireDeleteFile2k3desAuthM@24 @1240 + uFR_SAM_DesfireDeleteFile3k3desAuth = uFR_SAM_DesfireDeleteFile3k3desAuth@20 @1241 + uFR_SAM_DesfireDeleteFile3k3desAuthM = uFR_SAM_DesfireDeleteFile3k3desAuthM@24 @1242 + uFR_SAM_DesfireDeleteFileAesAuth = uFR_SAM_DesfireDeleteFileAesAuth@20 @1243 + uFR_SAM_DesfireDeleteFileAesAuthM = uFR_SAM_DesfireDeleteFileAesAuthM@24 @1244 + uFR_SAM_DesfireDeleteFileDesAuth = uFR_SAM_DesfireDeleteFileDesAuth@20 @1245 + uFR_SAM_DesfireDeleteFileDesAuthM = uFR_SAM_DesfireDeleteFileDesAuthM@24 @1246 + uFR_SAM_DesfireFormatCard2k3desAuth = uFR_SAM_DesfireFormatCard2k3desAuth@12 @1247 + uFR_SAM_DesfireFormatCard2k3desAuthM = uFR_SAM_DesfireFormatCard2k3desAuthM@16 @1248 + uFR_SAM_DesfireFormatCard3k3desAuth = uFR_SAM_DesfireFormatCard3k3desAuth@12 @1249 + uFR_SAM_DesfireFormatCard3k3desAuthM = uFR_SAM_DesfireFormatCard3k3desAuthM@16 @1250 + uFR_SAM_DesfireFormatCardAesAuth = uFR_SAM_DesfireFormatCardAesAuth@12 @1251 + uFR_SAM_DesfireFormatCardAesAuthM = uFR_SAM_DesfireFormatCardAesAuthM@16 @1252 + uFR_SAM_DesfireFormatCardDesAuth = uFR_SAM_DesfireFormatCardDesAuth@12 @1253 + uFR_SAM_DesfireFormatCardDesAuthM = uFR_SAM_DesfireFormatCardDesAuthM@16 @1254 + uFR_SAM_DesfireGetApplicationIds2k3desAuth = uFR_SAM_DesfireGetApplicationIds2k3desAuth@20 @1255 + uFR_SAM_DesfireGetApplicationIds2k3desAuthM = uFR_SAM_DesfireGetApplicationIds2k3desAuthM@24 @1256 + uFR_SAM_DesfireGetApplicationIds3k3desAuth = uFR_SAM_DesfireGetApplicationIds3k3desAuth@20 @1257 + uFR_SAM_DesfireGetApplicationIds3k3desAuthM = uFR_SAM_DesfireGetApplicationIds3k3desAuthM@24 @1258 + uFR_SAM_DesfireGetApplicationIdsAesAuth = uFR_SAM_DesfireGetApplicationIdsAesAuth@20 @1259 + uFR_SAM_DesfireGetApplicationIdsAesAuthM = uFR_SAM_DesfireGetApplicationIdsAesAuthM@24 @1260 + uFR_SAM_DesfireGetApplicationIdsDesAuth = uFR_SAM_DesfireGetApplicationIdsDesAuth@20 @1261 + uFR_SAM_DesfireGetApplicationIdsDesAuthM = uFR_SAM_DesfireGetApplicationIdsDesAuthM@24 @1262 + uFR_SAM_DesfireGetFileSettings2k3desAuth = uFR_SAM_DesfireGetFileSettings2k3desAuth@84 @1263 + uFR_SAM_DesfireGetFileSettings2k3desAuthM = uFR_SAM_DesfireGetFileSettings2k3desAuthM@88 @1264 + uFR_SAM_DesfireGetFileSettings3k3desAuth = uFR_SAM_DesfireGetFileSettings3k3desAuth@84 @1265 + uFR_SAM_DesfireGetFileSettings3k3desAuthM = uFR_SAM_DesfireGetFileSettings3k3desAuthM@88 @1266 + uFR_SAM_DesfireGetFileSettingsAesAuth = uFR_SAM_DesfireGetFileSettingsAesAuth@84 @1267 + uFR_SAM_DesfireGetFileSettingsAesAuthM = uFR_SAM_DesfireGetFileSettingsAesAuthM@88 @1268 + uFR_SAM_DesfireGetFileSettingsDesAuth = uFR_SAM_DesfireGetFileSettingsDesAuth@84 @1269 + uFR_SAM_DesfireGetFileSettingsDesAuthM = uFR_SAM_DesfireGetFileSettingsDesAuthM@88 @1270 + uFR_SAM_DesfireGetFileSettingsSdmAesAuth = uFR_SAM_DesfireGetFileSettingsSdmAesAuth@112 @1271 + uFR_SAM_DesfireGetFileSettingsSdmAesAuthM = uFR_SAM_DesfireGetFileSettingsSdmAesAuthM@116 @1272 + uFR_SAM_DesfireGetKeySettings2k3desAuth = uFR_SAM_DesfireGetKeySettings2k3desAuth@24 @1273 + uFR_SAM_DesfireGetKeySettings2k3desAuthM = uFR_SAM_DesfireGetKeySettings2k3desAuthM@28 @1274 + uFR_SAM_DesfireGetKeySettings3k3desAuth = uFR_SAM_DesfireGetKeySettings3k3desAuth@24 @1275 + uFR_SAM_DesfireGetKeySettings3k3desAuthM = uFR_SAM_DesfireGetKeySettings3k3desAuthM@28 @1276 + uFR_SAM_DesfireGetKeySettingsAesAuth = uFR_SAM_DesfireGetKeySettingsAesAuth@24 @1277 + uFR_SAM_DesfireGetKeySettingsAesAuthM = uFR_SAM_DesfireGetKeySettingsAesAuthM@28 @1278 + uFR_SAM_DesfireGetKeySettingsDesAuth = uFR_SAM_DesfireGetKeySettingsDesAuth@24 @1279 + uFR_SAM_DesfireGetKeySettingsDesAuthM = uFR_SAM_DesfireGetKeySettingsDesAuthM@28 @1280 + uFR_SAM_DesfireGetStdFileSize2k3desAuth = uFR_SAM_DesfireGetStdFileSize2k3desAuth@24 @1281 + uFR_SAM_DesfireGetStdFileSize2k3desAuthM = uFR_SAM_DesfireGetStdFileSize2k3desAuthM@28 @1282 + uFR_SAM_DesfireGetStdFileSize3k3desAuth = uFR_SAM_DesfireGetStdFileSize3k3desAuth@24 @1283 + uFR_SAM_DesfireGetStdFileSize3k3desAuthM = uFR_SAM_DesfireGetStdFileSize3k3desAuthM@28 @1284 + uFR_SAM_DesfireGetStdFileSizeAesAuth = uFR_SAM_DesfireGetStdFileSizeAesAuth@24 @1285 + uFR_SAM_DesfireGetStdFileSizeAesAuthM = uFR_SAM_DesfireGetStdFileSizeAesAuthM@28 @1286 + uFR_SAM_DesfireGetStdFileSizeDesAuth = uFR_SAM_DesfireGetStdFileSizeDesAuth@24 @1287 + uFR_SAM_DesfireGetStdFileSizeDesAuthM = uFR_SAM_DesfireGetStdFileSizeDesAuthM@28 @1288 + uFR_SAM_DesfireIncreaseValueFile2k3desAuth = uFR_SAM_DesfireIncreaseValueFile2k3desAuth@32 @1289 + uFR_SAM_DesfireIncreaseValueFile2k3desAuthM = uFR_SAM_DesfireIncreaseValueFile2k3desAuthM@36 @1290 + uFR_SAM_DesfireIncreaseValueFile3k3desAuth = uFR_SAM_DesfireIncreaseValueFile3k3desAuth@32 @1291 + uFR_SAM_DesfireIncreaseValueFile3k3desAuthM = uFR_SAM_DesfireIncreaseValueFile3k3desAuthM@36 @1292 + uFR_SAM_DesfireIncreaseValueFileAesAuth = uFR_SAM_DesfireIncreaseValueFileAesAuth@32 @1293 + uFR_SAM_DesfireIncreaseValueFileAesAuthM = uFR_SAM_DesfireIncreaseValueFileAesAuthM@36 @1294 + uFR_SAM_DesfireIncreaseValueFileDesAuth = uFR_SAM_DesfireIncreaseValueFileDesAuth@32 @1295 + uFR_SAM_DesfireIncreaseValueFileDesAuthM = uFR_SAM_DesfireIncreaseValueFileDesAuthM@36 @1296 + uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuth = uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuth@52 @1297 + uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM = uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM@56 @1298 + uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuth = uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuth@52 @1299 + uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM = uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM@56 @1300 + uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuth = uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuth@52 @1301 + uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM = uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM@56 @1302 + uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuth = uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuth@52 @1303 + uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM = uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM@56 @1304 + uFR_SAM_DesfireReadRecords2k3desAuth = uFR_SAM_DesfireReadRecords2k3desAuth@44 @1305 + uFR_SAM_DesfireReadRecords2k3desAuthM = uFR_SAM_DesfireReadRecords2k3desAuthM@48 @1306 + uFR_SAM_DesfireReadRecords3k3desAuth = uFR_SAM_DesfireReadRecords3k3desAuth@44 @1307 + uFR_SAM_DesfireReadRecords3k3desAuthM = uFR_SAM_DesfireReadRecords3k3desAuthM@48 @1308 + uFR_SAM_DesfireReadRecordsAesAuth = uFR_SAM_DesfireReadRecordsAesAuth@44 @1309 + uFR_SAM_DesfireReadRecordsAesAuthM = uFR_SAM_DesfireReadRecordsAesAuthM@48 @1310 + uFR_SAM_DesfireReadRecordsDesAuth = uFR_SAM_DesfireReadRecordsDesAuth@44 @1311 + uFR_SAM_DesfireReadRecordsDesAuthM = uFR_SAM_DesfireReadRecordsDesAuthM@48 @1312 + uFR_SAM_DesfireReadStdDataFile2k3desAuth = uFR_SAM_DesfireReadStdDataFile2k3desAuth@40 @1313 + uFR_SAM_DesfireReadStdDataFile2k3desAuthM = uFR_SAM_DesfireReadStdDataFile2k3desAuthM@44 @1314 + uFR_SAM_DesfireReadStdDataFile3k3desAuth = uFR_SAM_DesfireReadStdDataFile3k3desAuth@40 @1315 + uFR_SAM_DesfireReadStdDataFile3k3desAuthM = uFR_SAM_DesfireReadStdDataFile3k3desAuthM@44 @1316 + uFR_SAM_DesfireReadStdDataFileAesAuth = uFR_SAM_DesfireReadStdDataFileAesAuth@40 @1317 + uFR_SAM_DesfireReadStdDataFileAesAuthM = uFR_SAM_DesfireReadStdDataFileAesAuthM@44 @1318 + uFR_SAM_DesfireReadStdDataFileDesAuth = uFR_SAM_DesfireReadStdDataFileDesAuth@40 @1319 + uFR_SAM_DesfireReadStdDataFileDesAuthM = uFR_SAM_DesfireReadStdDataFileDesAuthM@44 @1320 + uFR_SAM_DesfireReadValueFile2k3desAuth = uFR_SAM_DesfireReadValueFile2k3desAuth@32 @1321 + uFR_SAM_DesfireReadValueFile2k3desAuthM = uFR_SAM_DesfireReadValueFile2k3desAuthM@36 @1322 + uFR_SAM_DesfireReadValueFile3k3desAuth = uFR_SAM_DesfireReadValueFile3k3desAuth@32 @1323 + uFR_SAM_DesfireReadValueFile3k3desAuthM = uFR_SAM_DesfireReadValueFile3k3desAuthM@36 @1324 + uFR_SAM_DesfireReadValueFileAesAuth = uFR_SAM_DesfireReadValueFileAesAuth@32 @1325 + uFR_SAM_DesfireReadValueFileAesAuthM = uFR_SAM_DesfireReadValueFileAesAuthM@36 @1326 + uFR_SAM_DesfireReadValueFileDesAuth = uFR_SAM_DesfireReadValueFileDesAuth@32 @1327 + uFR_SAM_DesfireReadValueFileDesAuthM = uFR_SAM_DesfireReadValueFileDesAuthM@36 @1328 + uFR_SAM_DesfireSetConfiguration2k3desAuth = uFR_SAM_DesfireSetConfiguration2k3desAuth@20 @1329 + uFR_SAM_DesfireSetConfiguration2k3desAuthM = uFR_SAM_DesfireSetConfiguration2k3desAuthM@24 @1330 + uFR_SAM_DesfireSetConfiguration3k3desAuth = uFR_SAM_DesfireSetConfiguration3k3desAuth@20 @1331 + uFR_SAM_DesfireSetConfiguration3k3desAuthM = uFR_SAM_DesfireSetConfiguration3k3desAuthM@24 @1332 + uFR_SAM_DesfireSetConfigurationAesAuth = uFR_SAM_DesfireSetConfigurationAesAuth@20 @1333 + uFR_SAM_DesfireSetConfigurationAesAuthM = uFR_SAM_DesfireSetConfigurationAesAuthM@24 @1334 + uFR_SAM_DesfireSetConfigurationDesAuth = uFR_SAM_DesfireSetConfigurationDesAuth@20 @1335 + uFR_SAM_DesfireSetConfigurationDesAuthM = uFR_SAM_DesfireSetConfigurationDesAuthM@24 @1336 + uFR_SAM_DesfireSetTransactionTimerAesAuth = uFR_SAM_DesfireSetTransactionTimerAesAuth@20 @1337 + uFR_SAM_DesfireSetTransactionTimerAesAuthM = uFR_SAM_DesfireSetTransactionTimerAesAuthM@24 @1338 + uFR_SAM_DesfireWriteBackupDataFile2k3desAuth = uFR_SAM_DesfireWriteBackupDataFile2k3desAuth@40 @1339 + uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM = uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM@44 @1340 + uFR_SAM_DesfireWriteBackupDataFile3k3desAuth = uFR_SAM_DesfireWriteBackupDataFile3k3desAuth@40 @1341 + uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM = uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM@44 @1342 + uFR_SAM_DesfireWriteBackupDataFileAesAuth = uFR_SAM_DesfireWriteBackupDataFileAesAuth@40 @1343 + uFR_SAM_DesfireWriteBackupDataFileAesAuthM = uFR_SAM_DesfireWriteBackupDataFileAesAuthM@44 @1344 + uFR_SAM_DesfireWriteBackupDataFileDesAuth = uFR_SAM_DesfireWriteBackupDataFileDesAuth@40 @1345 + uFR_SAM_DesfireWriteBackupDataFileDesAuthM = uFR_SAM_DesfireWriteBackupDataFileDesAuthM@44 @1346 + uFR_SAM_DesfireWriteRecord2k3desAuth = uFR_SAM_DesfireWriteRecord2k3desAuth@40 @1347 + uFR_SAM_DesfireWriteRecord2k3desAuthM = uFR_SAM_DesfireWriteRecord2k3desAuthM@44 @1348 + uFR_SAM_DesfireWriteRecord3k3desAuth = uFR_SAM_DesfireWriteRecord3k3desAuth@40 @1349 + uFR_SAM_DesfireWriteRecord3k3desAuthM = uFR_SAM_DesfireWriteRecord3k3desAuthM@44 @1350 + uFR_SAM_DesfireWriteRecordAesAuth = uFR_SAM_DesfireWriteRecordAesAuth@40 @1351 + uFR_SAM_DesfireWriteRecordAesAuthM = uFR_SAM_DesfireWriteRecordAesAuthM@44 @1352 + uFR_SAM_DesfireWriteRecordDesAuth = uFR_SAM_DesfireWriteRecordDesAuth@40 @1353 + uFR_SAM_DesfireWriteRecordDesAuthM = uFR_SAM_DesfireWriteRecordDesAuthM@44 @1354 + uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuth = uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuth@60 @1355 + uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM = uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM@64 @1356 + uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuth = uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuth@60 @1357 + uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM = uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM@64 @1358 + uFR_SAM_DesfireWriteRecord_TransMac_AesAuth = uFR_SAM_DesfireWriteRecord_TransMac_AesAuth@60 @1359 + uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM = uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM@64 @1360 + uFR_SAM_DesfireWriteRecord_TransMac_DesAuth = uFR_SAM_DesfireWriteRecord_TransMac_DesAuth@60 @1361 + uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM = uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM@64 @1362 + uFR_SAM_DesfireWriteStdDataFile2k3desAuth = uFR_SAM_DesfireWriteStdDataFile2k3desAuth@40 @1363 + uFR_SAM_DesfireWriteStdDataFile2k3desAuthM = uFR_SAM_DesfireWriteStdDataFile2k3desAuthM@44 @1364 + uFR_SAM_DesfireWriteStdDataFile3k3desAuth = uFR_SAM_DesfireWriteStdDataFile3k3desAuth@40 @1365 + uFR_SAM_DesfireWriteStdDataFile3k3desAuthM = uFR_SAM_DesfireWriteStdDataFile3k3desAuthM@44 @1366 + uFR_SAM_DesfireWriteStdDataFileAesAuth = uFR_SAM_DesfireWriteStdDataFileAesAuth@40 @1367 + uFR_SAM_DesfireWriteStdDataFileAesAuthM = uFR_SAM_DesfireWriteStdDataFileAesAuthM@44 @1368 + uFR_SAM_DesfireWriteStdDataFileDesAuth = uFR_SAM_DesfireWriteStdDataFileDesAuth@40 @1369 + uFR_SAM_DesfireWriteStdDataFileDesAuthM = uFR_SAM_DesfireWriteStdDataFileDesAuthM@44 @1370 + uFR_SAM_GetDesfireUid2k3desAuth = uFR_SAM_GetDesfireUid2k3desAuth@28 @1371 + uFR_SAM_GetDesfireUid2k3desAuthM = uFR_SAM_GetDesfireUid2k3desAuthM@32 @1372 + uFR_SAM_GetDesfireUid3k3desAuth = uFR_SAM_GetDesfireUid3k3desAuth@28 @1373 + uFR_SAM_GetDesfireUid3k3desAuthM = uFR_SAM_GetDesfireUid3k3desAuthM@32 @1374 + uFR_SAM_GetDesfireUidAesAuth = uFR_SAM_GetDesfireUidAesAuth@28 @1375 + uFR_SAM_GetDesfireUidAesAuthM = uFR_SAM_GetDesfireUidAesAuthM@32 @1376 + uFR_SAM_GetDesfireUidDesAuth = uFR_SAM_GetDesfireUidDesAuth@28 @1377 + uFR_SAM_GetDesfireUidDesAuthM = uFR_SAM_GetDesfireUidDesAuthM@32 @1378 + uFR_i_block_transceive = uFR_i_block_transceive@28 @1379 + uFR_i_block_transceiveM = uFR_i_block_transceiveM@32 @1380 + uFR_int_DesfireChange2K3DesKey_2k3des = uFR_int_DesfireChange2K3DesKey_2k3des@32 @1381 + uFR_int_DesfireChange2K3DesKey_2k3desM = uFR_int_DesfireChange2K3DesKey_2k3desM@36 @1382 + uFR_int_DesfireChange2K3DesKey_2k3des_PK = uFR_int_DesfireChange2K3DesKey_2k3des_PK@32 @1383 + uFR_int_DesfireChange2K3DesKey_2k3des_PK_M = uFR_int_DesfireChange2K3DesKey_2k3des_PK_M@36 @1384 + uFR_int_DesfireChange2K3DesKey_des = uFR_int_DesfireChange2K3DesKey_des@32 @1385 + uFR_int_DesfireChange2K3DesKey_desM = uFR_int_DesfireChange2K3DesKey_desM@36 @1386 + uFR_int_DesfireChange2K3DesKey_des_PK = uFR_int_DesfireChange2K3DesKey_des_PK@32 @1387 + uFR_int_DesfireChange2K3DesKey_des_PK_M = uFR_int_DesfireChange2K3DesKey_des_PK_M@36 @1388 + uFR_int_DesfireChange3K3DesKey_3k3des = uFR_int_DesfireChange3K3DesKey_3k3des@32 @1389 + uFR_int_DesfireChange3K3DesKey_3k3desM = uFR_int_DesfireChange3K3DesKey_3k3desM@36 @1390 + uFR_int_DesfireChange3K3DesKey_3k3des_PK = uFR_int_DesfireChange3K3DesKey_3k3des_PK@32 @1391 + uFR_int_DesfireChange3K3DesKey_3k3des_PK_M = uFR_int_DesfireChange3K3DesKey_3k3des_PK_M@36 @1392 + uFR_int_DesfireChangeAesKey = uFR_int_DesfireChangeAesKey@32 @1393 + uFR_int_DesfireChangeAesKeyM = uFR_int_DesfireChangeAesKeyM@36 @1394 + uFR_int_DesfireChangeAesKey_A = uFR_int_DesfireChangeAesKey_A@32 @1395 + uFR_int_DesfireChangeAesKey_PK = uFR_int_DesfireChangeAesKey_PK@32 @1396 + uFR_int_DesfireChangeAesKey_PK_M = uFR_int_DesfireChangeAesKey_PK_M@36 @1397 + uFR_int_DesfireChangeAesKey_aes = uFR_int_DesfireChangeAesKey_aes@32 @1398 + uFR_int_DesfireChangeAesKey_aesM = uFR_int_DesfireChangeAesKey_aesM@36 @1399 + uFR_int_DesfireChangeAesKey_aes_PK = uFR_int_DesfireChangeAesKey_aes_PK@32 @1400 + uFR_int_DesfireChangeAesKey_aes_PK_M = uFR_int_DesfireChangeAesKey_aes_PK_M@36 @1401 + uFR_int_DesfireChangeDesKey_2k3des = uFR_int_DesfireChangeDesKey_2k3des@32 @1402 + uFR_int_DesfireChangeDesKey_2k3desM = uFR_int_DesfireChangeDesKey_2k3desM@36 @1403 + uFR_int_DesfireChangeDesKey_2k3des_PK = uFR_int_DesfireChangeDesKey_2k3des_PK@32 @1404 + uFR_int_DesfireChangeDesKey_2k3des_PK_M = uFR_int_DesfireChangeDesKey_2k3des_PK_M@36 @1405 + uFR_int_DesfireChangeDesKey_des = uFR_int_DesfireChangeDesKey_des@32 @1406 + uFR_int_DesfireChangeDesKey_desM = uFR_int_DesfireChangeDesKey_desM@36 @1407 + uFR_int_DesfireChangeDesKey_des_PK = uFR_int_DesfireChangeDesKey_des_PK@32 @1408 + uFR_int_DesfireChangeDesKey_des_PK_M = uFR_int_DesfireChangeDesKey_des_PK_M@36 @1409 + uFR_int_DesfireChangeFileSettingsSdm = uFR_int_DesfireChangeFileSettingsSdm@100 @1410 + uFR_int_DesfireChangeFileSettingsSdmM = uFR_int_DesfireChangeFileSettingsSdmM@104 @1411 + uFR_int_DesfireChangeFileSettingsSdm_PK = uFR_int_DesfireChangeFileSettingsSdm_PK@100 @1412 + uFR_int_DesfireChangeFileSettingsSdm_PK_M = uFR_int_DesfireChangeFileSettingsSdm_PK_M@104 @1413 + uFR_int_DesfireChangeFileSettings_2k3des = uFR_int_DesfireChangeFileSettings_2k3des@40 @1414 + uFR_int_DesfireChangeFileSettings_2k3desM = uFR_int_DesfireChangeFileSettings_2k3desM@44 @1415 + uFR_int_DesfireChangeFileSettings_2k3des_PK = uFR_int_DesfireChangeFileSettings_2k3des_PK@40 @1416 + uFR_int_DesfireChangeFileSettings_2k3des_PK_M = uFR_int_DesfireChangeFileSettings_2k3des_PK_M@44 @1417 + uFR_int_DesfireChangeFileSettings_3k3des = uFR_int_DesfireChangeFileSettings_3k3des@40 @1418 + uFR_int_DesfireChangeFileSettings_3k3desM = uFR_int_DesfireChangeFileSettings_3k3desM@44 @1419 + uFR_int_DesfireChangeFileSettings_3k3des_PK = uFR_int_DesfireChangeFileSettings_3k3des_PK@40 @1420 + uFR_int_DesfireChangeFileSettings_3k3des_PK_M = uFR_int_DesfireChangeFileSettings_3k3des_PK_M@44 @1421 + uFR_int_DesfireChangeFileSettings_aes = uFR_int_DesfireChangeFileSettings_aes@40 @1422 + uFR_int_DesfireChangeFileSettings_aesM = uFR_int_DesfireChangeFileSettings_aesM@44 @1423 + uFR_int_DesfireChangeFileSettings_aes_PK = uFR_int_DesfireChangeFileSettings_aes_PK@40 @1424 + uFR_int_DesfireChangeFileSettings_aes_PK_M = uFR_int_DesfireChangeFileSettings_aes_PK_M@44 @1425 + uFR_int_DesfireChangeFileSettings_des = uFR_int_DesfireChangeFileSettings_des@40 @1426 + uFR_int_DesfireChangeFileSettings_desM = uFR_int_DesfireChangeFileSettings_desM@44 @1427 + uFR_int_DesfireChangeFileSettings_des_PK = uFR_int_DesfireChangeFileSettings_des_PK@40 @1428 + uFR_int_DesfireChangeFileSettings_des_PK_M = uFR_int_DesfireChangeFileSettings_des_PK_M@44 @1429 + uFR_int_DesfireChangeKeySettings = uFR_int_DesfireChangeKeySettings@20 @1430 + uFR_int_DesfireChangeKeySettingsM = uFR_int_DesfireChangeKeySettingsM@24 @1431 + uFR_int_DesfireChangeKeySettings_2k3des = uFR_int_DesfireChangeKeySettings_2k3des@20 @1432 + uFR_int_DesfireChangeKeySettings_2k3desM = uFR_int_DesfireChangeKeySettings_2k3desM@24 @1433 + uFR_int_DesfireChangeKeySettings_2k3des_PK = uFR_int_DesfireChangeKeySettings_2k3des_PK@20 @1434 + uFR_int_DesfireChangeKeySettings_2k3des_PK_M = uFR_int_DesfireChangeKeySettings_2k3des_PK_M@24 @1435 + uFR_int_DesfireChangeKeySettings_3k3des = uFR_int_DesfireChangeKeySettings_3k3des@20 @1436 + uFR_int_DesfireChangeKeySettings_3k3desM = uFR_int_DesfireChangeKeySettings_3k3desM@24 @1437 + uFR_int_DesfireChangeKeySettings_3k3des_PK = uFR_int_DesfireChangeKeySettings_3k3des_PK@20 @1438 + uFR_int_DesfireChangeKeySettings_3k3des_PK_M = uFR_int_DesfireChangeKeySettings_3k3des_PK_M@24 @1439 + uFR_int_DesfireChangeKeySettings_PK = uFR_int_DesfireChangeKeySettings_PK@20 @1440 + uFR_int_DesfireChangeKeySettings_PK_M = uFR_int_DesfireChangeKeySettings_PK_M@24 @1441 + uFR_int_DesfireChangeKeySettings_aes = uFR_int_DesfireChangeKeySettings_aes@20 @1442 + uFR_int_DesfireChangeKeySettings_aesM = uFR_int_DesfireChangeKeySettings_aesM@24 @1443 + uFR_int_DesfireChangeKeySettings_aes_PK = uFR_int_DesfireChangeKeySettings_aes_PK@20 @1444 + uFR_int_DesfireChangeKeySettings_aes_PK_M = uFR_int_DesfireChangeKeySettings_aes_PK_M@24 @1445 + uFR_int_DesfireChangeKeySettings_des = uFR_int_DesfireChangeKeySettings_des@20 @1446 + uFR_int_DesfireChangeKeySettings_desM = uFR_int_DesfireChangeKeySettings_desM@24 @1447 + uFR_int_DesfireChangeKeySettings_des_PK = uFR_int_DesfireChangeKeySettings_des_PK@20 @1448 + uFR_int_DesfireChangeKeySettings_des_PK_M = uFR_int_DesfireChangeKeySettings_des_PK_M@24 @1449 + uFR_int_DesfireChangeMasterKey = uFR_int_DesfireChangeMasterKey@24 @1450 + uFR_int_DesfireChangeMasterKeyM = uFR_int_DesfireChangeMasterKeyM@28 @1451 + uFR_int_DesfireChangeMasterKey_PK = uFR_int_DesfireChangeMasterKey_PK@24 @1452 + uFR_int_DesfireChangeMasterKey_PK_M = uFR_int_DesfireChangeMasterKey_PK_M@28 @1453 + uFR_int_DesfireClearRecordFile = uFR_int_DesfireClearRecordFile@20 @1454 + uFR_int_DesfireClearRecordFile_2k3des = uFR_int_DesfireClearRecordFile_2k3des@20 @1455 + uFR_int_DesfireClearRecordFile_2k3desM = uFR_int_DesfireClearRecordFile_2k3desM@24 @1456 + uFR_int_DesfireClearRecordFile_2k3des_2 = uFR_int_DesfireClearRecordFile_2k3des_2@24 @1457 + uFR_int_DesfireClearRecordFile_2k3des_2M = uFR_int_DesfireClearRecordFile_2k3des_2M@28 @1458 + uFR_int_DesfireClearRecordFile_2k3des_PK = uFR_int_DesfireClearRecordFile_2k3des_PK@20 @1459 + uFR_int_DesfireClearRecordFile_2k3des_PK_2 = uFR_int_DesfireClearRecordFile_2k3des_PK_2@24 @1460 + uFR_int_DesfireClearRecordFile_2k3des_PK_2M = uFR_int_DesfireClearRecordFile_2k3des_PK_2M@28 @1461 + uFR_int_DesfireClearRecordFile_2k3des_PK_M = uFR_int_DesfireClearRecordFile_2k3des_PK_M@24 @1462 + uFR_int_DesfireClearRecordFile_3k3des = uFR_int_DesfireClearRecordFile_3k3des@20 @1463 + uFR_int_DesfireClearRecordFile_3k3desM = uFR_int_DesfireClearRecordFile_3k3desM@24 @1464 + uFR_int_DesfireClearRecordFile_3k3des_2 = uFR_int_DesfireClearRecordFile_3k3des_2@24 @1465 + uFR_int_DesfireClearRecordFile_3k3des_2M = uFR_int_DesfireClearRecordFile_3k3des_2M@28 @1466 + uFR_int_DesfireClearRecordFile_3k3des_PK = uFR_int_DesfireClearRecordFile_3k3des_PK@20 @1467 + uFR_int_DesfireClearRecordFile_3k3des_PK_2 = uFR_int_DesfireClearRecordFile_3k3des_PK_2@24 @1468 + uFR_int_DesfireClearRecordFile_3k3des_PK_2M = uFR_int_DesfireClearRecordFile_3k3des_PK_2M@28 @1469 + uFR_int_DesfireClearRecordFile_3k3des_PK_M = uFR_int_DesfireClearRecordFile_3k3des_PK_M@24 @1470 + uFR_int_DesfireClearRecordFile_PK = uFR_int_DesfireClearRecordFile_PK@20 @1471 + uFR_int_DesfireClearRecordFile_PK_2 = uFR_int_DesfireClearRecordFile_PK_2@24 @1472 + uFR_int_DesfireClearRecordFile_TransMac_2k3des = uFR_int_DesfireClearRecordFile_TransMac_2k3des@44 @1473 + uFR_int_DesfireClearRecordFile_TransMac_2k3desM = uFR_int_DesfireClearRecordFile_TransMac_2k3desM@48 @1474 + uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK = uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK@44 @1475 + uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M = uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M@48 @1476 + uFR_int_DesfireClearRecordFile_TransMac_3k3des = uFR_int_DesfireClearRecordFile_TransMac_3k3des@44 @1477 + uFR_int_DesfireClearRecordFile_TransMac_3k3desM = uFR_int_DesfireClearRecordFile_TransMac_3k3desM@48 @1478 + uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK = uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK@44 @1479 + uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M = uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M@48 @1480 + uFR_int_DesfireClearRecordFile_TransMac_aes = uFR_int_DesfireClearRecordFile_TransMac_aes@44 @1481 + uFR_int_DesfireClearRecordFile_TransMac_aesM = uFR_int_DesfireClearRecordFile_TransMac_aesM@48 @1482 + uFR_int_DesfireClearRecordFile_TransMac_aes_PK = uFR_int_DesfireClearRecordFile_TransMac_aes_PK@44 @1483 + uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M = uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M@48 @1484 + uFR_int_DesfireClearRecordFile_TransMac_des = uFR_int_DesfireClearRecordFile_TransMac_des@44 @1485 + uFR_int_DesfireClearRecordFile_TransMac_desM = uFR_int_DesfireClearRecordFile_TransMac_desM@48 @1486 + uFR_int_DesfireClearRecordFile_TransMac_des_PK = uFR_int_DesfireClearRecordFile_TransMac_des_PK@44 @1487 + uFR_int_DesfireClearRecordFile_TransMac_des_PK_M = uFR_int_DesfireClearRecordFile_TransMac_des_PK_M@48 @1488 + uFR_int_DesfireClearRecordFile_TransMac_no_auth = uFR_int_DesfireClearRecordFile_TransMac_no_auth@36 @1489 + uFR_int_DesfireClearRecordFile_TransMac_no_auth_M = uFR_int_DesfireClearRecordFile_TransMac_no_auth_M@40 @1490 + uFR_int_DesfireClearRecordFile_aes = uFR_int_DesfireClearRecordFile_aes@20 @1491 + uFR_int_DesfireClearRecordFile_aesM = uFR_int_DesfireClearRecordFile_aesM@24 @1492 + uFR_int_DesfireClearRecordFile_aes_2 = uFR_int_DesfireClearRecordFile_aes_2@24 @1493 + uFR_int_DesfireClearRecordFile_aes_2M = uFR_int_DesfireClearRecordFile_aes_2M@28 @1494 + uFR_int_DesfireClearRecordFile_aes_PK = uFR_int_DesfireClearRecordFile_aes_PK@20 @1495 + uFR_int_DesfireClearRecordFile_aes_PK_2 = uFR_int_DesfireClearRecordFile_aes_PK_2@24 @1496 + uFR_int_DesfireClearRecordFile_aes_PK_2M = uFR_int_DesfireClearRecordFile_aes_PK_2M@28 @1497 + uFR_int_DesfireClearRecordFile_aes_PK_M = uFR_int_DesfireClearRecordFile_aes_PK_M@24 @1498 + uFR_int_DesfireClearRecordFile_des = uFR_int_DesfireClearRecordFile_des@20 @1499 + uFR_int_DesfireClearRecordFile_desM = uFR_int_DesfireClearRecordFile_desM@24 @1500 + uFR_int_DesfireClearRecordFile_des_2 = uFR_int_DesfireClearRecordFile_des_2@24 @1501 + uFR_int_DesfireClearRecordFile_des_2M = uFR_int_DesfireClearRecordFile_des_2M@28 @1502 + uFR_int_DesfireClearRecordFile_des_PK = uFR_int_DesfireClearRecordFile_des_PK@20 @1503 + uFR_int_DesfireClearRecordFile_des_PK_2 = uFR_int_DesfireClearRecordFile_des_PK_2@24 @1504 + uFR_int_DesfireClearRecordFile_des_PK_2M = uFR_int_DesfireClearRecordFile_des_PK_2M@28 @1505 + uFR_int_DesfireClearRecordFile_des_PK_M = uFR_int_DesfireClearRecordFile_des_PK_M@24 @1506 + uFR_int_DesfireClearRecordFile_no_auth = uFR_int_DesfireClearRecordFile_no_auth@16 @1507 + uFR_int_DesfireClearRecordFile_no_authM = uFR_int_DesfireClearRecordFile_no_authM@20 @1508 + uFR_int_DesfireCreate3k3desApplication_2k3des = uFR_int_DesfireCreate3k3desApplication_2k3des@24 @1509 + uFR_int_DesfireCreate3k3desApplication_2k3desM = uFR_int_DesfireCreate3k3desApplication_2k3desM@28 @1510 + uFR_int_DesfireCreate3k3desApplication_2k3des_PK = uFR_int_DesfireCreate3k3desApplication_2k3des_PK@24 @1511 + uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M = uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M@28 @1512 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso = uFR_int_DesfireCreate3k3desApplication_2k3des_iso@36 @1513 + uFR_int_DesfireCreate3k3desApplication_2k3des_isoM = uFR_int_DesfireCreate3k3desApplication_2k3des_isoM@40 @1514 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK = uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK@36 @1515 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M = uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M@40 @1516 + uFR_int_DesfireCreate3k3desApplication_3k3des = uFR_int_DesfireCreate3k3desApplication_3k3des@24 @1517 + uFR_int_DesfireCreate3k3desApplication_3k3desM = uFR_int_DesfireCreate3k3desApplication_3k3desM@28 @1518 + uFR_int_DesfireCreate3k3desApplication_3k3des_PK = uFR_int_DesfireCreate3k3desApplication_3k3des_PK@24 @1519 + uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M = uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M@28 @1520 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso = uFR_int_DesfireCreate3k3desApplication_3k3des_iso@36 @1521 + uFR_int_DesfireCreate3k3desApplication_3k3des_isoM = uFR_int_DesfireCreate3k3desApplication_3k3des_isoM@40 @1522 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK = uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK@36 @1523 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M = uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M@40 @1524 + uFR_int_DesfireCreate3k3desApplication_aes = uFR_int_DesfireCreate3k3desApplication_aes@24 @1525 + uFR_int_DesfireCreate3k3desApplication_aesM = uFR_int_DesfireCreate3k3desApplication_aesM@28 @1526 + uFR_int_DesfireCreate3k3desApplication_aes_PK = uFR_int_DesfireCreate3k3desApplication_aes_PK@24 @1527 + uFR_int_DesfireCreate3k3desApplication_aes_PK_M = uFR_int_DesfireCreate3k3desApplication_aes_PK_M@28 @1528 + uFR_int_DesfireCreate3k3desApplication_aes_iso = uFR_int_DesfireCreate3k3desApplication_aes_iso@36 @1529 + uFR_int_DesfireCreate3k3desApplication_aes_isoM = uFR_int_DesfireCreate3k3desApplication_aes_isoM@40 @1530 + uFR_int_DesfireCreate3k3desApplication_aes_iso_PK = uFR_int_DesfireCreate3k3desApplication_aes_iso_PK@36 @1531 + uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M = uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M@40 @1532 + uFR_int_DesfireCreate3k3desApplication_des = uFR_int_DesfireCreate3k3desApplication_des@24 @1533 + uFR_int_DesfireCreate3k3desApplication_desM = uFR_int_DesfireCreate3k3desApplication_desM@28 @1534 + uFR_int_DesfireCreate3k3desApplication_des_PK = uFR_int_DesfireCreate3k3desApplication_des_PK@24 @1535 + uFR_int_DesfireCreate3k3desApplication_des_PK_M = uFR_int_DesfireCreate3k3desApplication_des_PK_M@28 @1536 + uFR_int_DesfireCreate3k3desApplication_des_iso = uFR_int_DesfireCreate3k3desApplication_des_iso@36 @1537 + uFR_int_DesfireCreate3k3desApplication_des_isoM = uFR_int_DesfireCreate3k3desApplication_des_isoM@40 @1538 + uFR_int_DesfireCreate3k3desApplication_des_iso_PK = uFR_int_DesfireCreate3k3desApplication_des_iso_PK@36 @1539 + uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M = uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M@40 @1540 + uFR_int_DesfireCreate3k3desApplication_no_auth = uFR_int_DesfireCreate3k3desApplication_no_auth@20 @1541 + uFR_int_DesfireCreate3k3desApplication_no_auth_M = uFR_int_DesfireCreate3k3desApplication_no_auth_M@24 @1542 + uFR_int_DesfireCreate3k3desApplication_no_auth_iso = uFR_int_DesfireCreate3k3desApplication_no_auth_iso@32 @1543 + uFR_int_DesfireCreate3k3desApplication_no_auth_isoM = uFR_int_DesfireCreate3k3desApplication_no_auth_isoM@36 @1544 + uFR_int_DesfireCreateAesApplication = uFR_int_DesfireCreateAesApplication@24 @1545 + uFR_int_DesfireCreateAesApplicationM = uFR_int_DesfireCreateAesApplicationM@28 @1546 + uFR_int_DesfireCreateAesApplication_2k3des = uFR_int_DesfireCreateAesApplication_2k3des@24 @1547 + uFR_int_DesfireCreateAesApplication_2k3desM = uFR_int_DesfireCreateAesApplication_2k3desM@28 @1548 + uFR_int_DesfireCreateAesApplication_2k3des_PK = uFR_int_DesfireCreateAesApplication_2k3des_PK@24 @1549 + uFR_int_DesfireCreateAesApplication_2k3des_PK_M = uFR_int_DesfireCreateAesApplication_2k3des_PK_M@28 @1550 + uFR_int_DesfireCreateAesApplication_2k3des_iso = uFR_int_DesfireCreateAesApplication_2k3des_iso@36 @1551 + uFR_int_DesfireCreateAesApplication_2k3des_isoM = uFR_int_DesfireCreateAesApplication_2k3des_isoM@40 @1552 + uFR_int_DesfireCreateAesApplication_2k3des_iso_PK = uFR_int_DesfireCreateAesApplication_2k3des_iso_PK@36 @1553 + uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M = uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M@40 @1554 + uFR_int_DesfireCreateAesApplication_3k3des = uFR_int_DesfireCreateAesApplication_3k3des@24 @1555 + uFR_int_DesfireCreateAesApplication_3k3desM = uFR_int_DesfireCreateAesApplication_3k3desM@28 @1556 + uFR_int_DesfireCreateAesApplication_3k3des_PK = uFR_int_DesfireCreateAesApplication_3k3des_PK@24 @1557 + uFR_int_DesfireCreateAesApplication_3k3des_PK_M = uFR_int_DesfireCreateAesApplication_3k3des_PK_M@28 @1558 + uFR_int_DesfireCreateAesApplication_3k3des_iso = uFR_int_DesfireCreateAesApplication_3k3des_iso@36 @1559 + uFR_int_DesfireCreateAesApplication_3k3des_isoM = uFR_int_DesfireCreateAesApplication_3k3des_isoM@40 @1560 + uFR_int_DesfireCreateAesApplication_3k3des_iso_PK = uFR_int_DesfireCreateAesApplication_3k3des_iso_PK@36 @1561 + uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M = uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M@40 @1562 + uFR_int_DesfireCreateAesApplication_PK = uFR_int_DesfireCreateAesApplication_PK@24 @1563 + uFR_int_DesfireCreateAesApplication_PK_M = uFR_int_DesfireCreateAesApplication_PK_M@28 @1564 + uFR_int_DesfireCreateAesApplication_aes = uFR_int_DesfireCreateAesApplication_aes@24 @1565 + uFR_int_DesfireCreateAesApplication_aesM = uFR_int_DesfireCreateAesApplication_aesM@28 @1566 + uFR_int_DesfireCreateAesApplication_aes_PK = uFR_int_DesfireCreateAesApplication_aes_PK@24 @1567 + uFR_int_DesfireCreateAesApplication_aes_PK_M = uFR_int_DesfireCreateAesApplication_aes_PK_M@28 @1568 + uFR_int_DesfireCreateAesApplication_aes_iso = uFR_int_DesfireCreateAesApplication_aes_iso@36 @1569 + uFR_int_DesfireCreateAesApplication_aes_isoM = uFR_int_DesfireCreateAesApplication_aes_isoM@40 @1570 + uFR_int_DesfireCreateAesApplication_aes_iso_PK = uFR_int_DesfireCreateAesApplication_aes_iso_PK@36 @1571 + uFR_int_DesfireCreateAesApplication_aes_iso_PK_M = uFR_int_DesfireCreateAesApplication_aes_iso_PK_M@40 @1572 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd = uFR_int_DesfireCreateAesApplication_aes_iso_ascd@36 @1573 + uFR_int_DesfireCreateAesApplication_aes_iso_ascdM = uFR_int_DesfireCreateAesApplication_aes_iso_ascdM@40 @1574 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK = uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK@36 @1575 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M = uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M@40 @1576 + uFR_int_DesfireCreateAesApplication_des = uFR_int_DesfireCreateAesApplication_des@24 @1577 + uFR_int_DesfireCreateAesApplication_desM = uFR_int_DesfireCreateAesApplication_desM@28 @1578 + uFR_int_DesfireCreateAesApplication_des_PK = uFR_int_DesfireCreateAesApplication_des_PK@24 @1579 + uFR_int_DesfireCreateAesApplication_des_PK_M = uFR_int_DesfireCreateAesApplication_des_PK_M@28 @1580 + uFR_int_DesfireCreateAesApplication_des_iso = uFR_int_DesfireCreateAesApplication_des_iso@36 @1581 + uFR_int_DesfireCreateAesApplication_des_isoM = uFR_int_DesfireCreateAesApplication_des_isoM@40 @1582 + uFR_int_DesfireCreateAesApplication_des_iso_PK = uFR_int_DesfireCreateAesApplication_des_iso_PK@36 @1583 + uFR_int_DesfireCreateAesApplication_des_iso_PK_M = uFR_int_DesfireCreateAesApplication_des_iso_PK_M@40 @1584 + uFR_int_DesfireCreateAesApplication_no_auth = uFR_int_DesfireCreateAesApplication_no_auth@20 @1585 + uFR_int_DesfireCreateAesApplication_no_auth_M = uFR_int_DesfireCreateAesApplication_no_auth_M@24 @1586 + uFR_int_DesfireCreateAesApplication_no_auth_iso = uFR_int_DesfireCreateAesApplication_no_auth_iso@32 @1587 + uFR_int_DesfireCreateAesApplication_no_auth_isoM = uFR_int_DesfireCreateAesApplication_no_auth_isoM@36 @1588 + uFR_int_DesfireCreateBackupDataFile_2k3des = uFR_int_DesfireCreateBackupDataFile_2k3des@44 @1589 + uFR_int_DesfireCreateBackupDataFile_2k3desM = uFR_int_DesfireCreateBackupDataFile_2k3desM@48 @1590 + uFR_int_DesfireCreateBackupDataFile_2k3des_PK = uFR_int_DesfireCreateBackupDataFile_2k3des_PK@44 @1591 + uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M = uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M@48 @1592 + uFR_int_DesfireCreateBackupDataFile_3k3des = uFR_int_DesfireCreateBackupDataFile_3k3des@44 @1593 + uFR_int_DesfireCreateBackupDataFile_3k3desM = uFR_int_DesfireCreateBackupDataFile_3k3desM@48 @1594 + uFR_int_DesfireCreateBackupDataFile_3k3des_PK = uFR_int_DesfireCreateBackupDataFile_3k3des_PK@44 @1595 + uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M = uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M@48 @1596 + uFR_int_DesfireCreateBackupDataFile_PK = uFR_int_DesfireCreateBackupDataFile_PK@44 @1597 + uFR_int_DesfireCreateBackupDataFile_aes = uFR_int_DesfireCreateBackupDataFile_aes@44 @1598 + uFR_int_DesfireCreateBackupDataFile_aesM = uFR_int_DesfireCreateBackupDataFile_aesM@48 @1599 + uFR_int_DesfireCreateBackupDataFile_aes_PK = uFR_int_DesfireCreateBackupDataFile_aes_PK@44 @1600 + uFR_int_DesfireCreateBackupDataFile_aes_PK_M = uFR_int_DesfireCreateBackupDataFile_aes_PK_M@48 @1601 + uFR_int_DesfireCreateBackupDataFile_des = uFR_int_DesfireCreateBackupDataFile_des@44 @1602 + uFR_int_DesfireCreateBackupDataFile_desM = uFR_int_DesfireCreateBackupDataFile_desM@48 @1603 + uFR_int_DesfireCreateBackupDataFile_des_PK = uFR_int_DesfireCreateBackupDataFile_des_PK@44 @1604 + uFR_int_DesfireCreateBackupDataFile_des_PK_M = uFR_int_DesfireCreateBackupDataFile_des_PK_M@48 @1605 + uFR_int_DesfireCreateBackupDataFile_no_auth = uFR_int_DesfireCreateBackupDataFile_no_auth@40 @1606 + uFR_int_DesfireCreateBackupDataFile_no_auth_M = uFR_int_DesfireCreateBackupDataFile_no_auth_M@44 @1607 + uFR_int_DesfireCreateCyclicRecordFile_2k3des = uFR_int_DesfireCreateCyclicRecordFile_2k3des@48 @1608 + uFR_int_DesfireCreateCyclicRecordFile_2k3desM = uFR_int_DesfireCreateCyclicRecordFile_2k3desM@52 @1609 + uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK = uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK@48 @1610 + uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M = uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M@52 @1611 + uFR_int_DesfireCreateCyclicRecordFile_3k3des = uFR_int_DesfireCreateCyclicRecordFile_3k3des@48 @1612 + uFR_int_DesfireCreateCyclicRecordFile_3k3desM = uFR_int_DesfireCreateCyclicRecordFile_3k3desM@52 @1613 + uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK = uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK@48 @1614 + uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M = uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M@52 @1615 + uFR_int_DesfireCreateCyclicRecordFile_aes = uFR_int_DesfireCreateCyclicRecordFile_aes@48 @1616 + uFR_int_DesfireCreateCyclicRecordFile_aesM = uFR_int_DesfireCreateCyclicRecordFile_aesM@52 @1617 + uFR_int_DesfireCreateCyclicRecordFile_aes_PK = uFR_int_DesfireCreateCyclicRecordFile_aes_PK@48 @1618 + uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M = uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M@52 @1619 + uFR_int_DesfireCreateCyclicRecordFile_des = uFR_int_DesfireCreateCyclicRecordFile_des@48 @1620 + uFR_int_DesfireCreateCyclicRecordFile_desM = uFR_int_DesfireCreateCyclicRecordFile_desM@52 @1621 + uFR_int_DesfireCreateCyclicRecordFile_des_PK = uFR_int_DesfireCreateCyclicRecordFile_des_PK@48 @1622 + uFR_int_DesfireCreateCyclicRecordFile_des_PK_M = uFR_int_DesfireCreateCyclicRecordFile_des_PK_M@52 @1623 + uFR_int_DesfireCreateCyclicRecordFile_no_auth = uFR_int_DesfireCreateCyclicRecordFile_no_auth@44 @1624 + uFR_int_DesfireCreateCyclicRecordFile_no_authM = uFR_int_DesfireCreateCyclicRecordFile_no_authM@48 @1625 + uFR_int_DesfireCreateDesApplication_2k3des = uFR_int_DesfireCreateDesApplication_2k3des@24 @1626 + uFR_int_DesfireCreateDesApplication_2k3desM = uFR_int_DesfireCreateDesApplication_2k3desM@28 @1627 + uFR_int_DesfireCreateDesApplication_2k3des_PK = uFR_int_DesfireCreateDesApplication_2k3des_PK@24 @1628 + uFR_int_DesfireCreateDesApplication_2k3des_PK_M = uFR_int_DesfireCreateDesApplication_2k3des_PK_M@28 @1629 + uFR_int_DesfireCreateDesApplication_2k3des_iso = uFR_int_DesfireCreateDesApplication_2k3des_iso@36 @1630 + uFR_int_DesfireCreateDesApplication_2k3des_isoM = uFR_int_DesfireCreateDesApplication_2k3des_isoM@40 @1631 + uFR_int_DesfireCreateDesApplication_2k3des_iso_PK = uFR_int_DesfireCreateDesApplication_2k3des_iso_PK@36 @1632 + uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M = uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M@40 @1633 + uFR_int_DesfireCreateDesApplication_3k3des = uFR_int_DesfireCreateDesApplication_3k3des@24 @1634 + uFR_int_DesfireCreateDesApplication_3k3desM = uFR_int_DesfireCreateDesApplication_3k3desM@28 @1635 + uFR_int_DesfireCreateDesApplication_3k3des_PK = uFR_int_DesfireCreateDesApplication_3k3des_PK@24 @1636 + uFR_int_DesfireCreateDesApplication_3k3des_PK_M = uFR_int_DesfireCreateDesApplication_3k3des_PK_M@28 @1637 + uFR_int_DesfireCreateDesApplication_3k3des_iso = uFR_int_DesfireCreateDesApplication_3k3des_iso@36 @1638 + uFR_int_DesfireCreateDesApplication_3k3des_isoM = uFR_int_DesfireCreateDesApplication_3k3des_isoM@40 @1639 + uFR_int_DesfireCreateDesApplication_3k3des_iso_PK = uFR_int_DesfireCreateDesApplication_3k3des_iso_PK@36 @1640 + uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M = uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M@40 @1641 + uFR_int_DesfireCreateDesApplication_aes = uFR_int_DesfireCreateDesApplication_aes@24 @1642 + uFR_int_DesfireCreateDesApplication_aesM = uFR_int_DesfireCreateDesApplication_aesM@28 @1643 + uFR_int_DesfireCreateDesApplication_aes_PK = uFR_int_DesfireCreateDesApplication_aes_PK@24 @1644 + uFR_int_DesfireCreateDesApplication_aes_PK_M = uFR_int_DesfireCreateDesApplication_aes_PK_M@28 @1645 + uFR_int_DesfireCreateDesApplication_aes_iso = uFR_int_DesfireCreateDesApplication_aes_iso@36 @1646 + uFR_int_DesfireCreateDesApplication_aes_isoM = uFR_int_DesfireCreateDesApplication_aes_isoM@40 @1647 + uFR_int_DesfireCreateDesApplication_aes_iso_PK = uFR_int_DesfireCreateDesApplication_aes_iso_PK@36 @1648 + uFR_int_DesfireCreateDesApplication_aes_iso_PK_M = uFR_int_DesfireCreateDesApplication_aes_iso_PK_M@40 @1649 + uFR_int_DesfireCreateDesApplication_des = uFR_int_DesfireCreateDesApplication_des@24 @1650 + uFR_int_DesfireCreateDesApplication_desM = uFR_int_DesfireCreateDesApplication_desM@28 @1651 + uFR_int_DesfireCreateDesApplication_des_PK = uFR_int_DesfireCreateDesApplication_des_PK@24 @1652 + uFR_int_DesfireCreateDesApplication_des_PK_M = uFR_int_DesfireCreateDesApplication_des_PK_M@28 @1653 + uFR_int_DesfireCreateDesApplication_des_iso = uFR_int_DesfireCreateDesApplication_des_iso@36 @1654 + uFR_int_DesfireCreateDesApplication_des_isoM = uFR_int_DesfireCreateDesApplication_des_isoM@40 @1655 + uFR_int_DesfireCreateDesApplication_des_iso_PK = uFR_int_DesfireCreateDesApplication_des_iso_PK@36 @1656 + uFR_int_DesfireCreateDesApplication_des_iso_PK_M = uFR_int_DesfireCreateDesApplication_des_iso_PK_M@40 @1657 + uFR_int_DesfireCreateDesApplication_no_auth = uFR_int_DesfireCreateDesApplication_no_auth@20 @1658 + uFR_int_DesfireCreateDesApplication_no_auth_M = uFR_int_DesfireCreateDesApplication_no_auth_M@24 @1659 + uFR_int_DesfireCreateDesApplication_no_auth_iso = uFR_int_DesfireCreateDesApplication_no_auth_iso@32 @1660 + uFR_int_DesfireCreateDesApplication_no_auth_isoM = uFR_int_DesfireCreateDesApplication_no_auth_isoM@36 @1661 + uFR_int_DesfireCreateLinearRecordFile_2k3des = uFR_int_DesfireCreateLinearRecordFile_2k3des@48 @1662 + uFR_int_DesfireCreateLinearRecordFile_2k3desM = uFR_int_DesfireCreateLinearRecordFile_2k3desM@52 @1663 + uFR_int_DesfireCreateLinearRecordFile_2k3des_PK = uFR_int_DesfireCreateLinearRecordFile_2k3des_PK@48 @1664 + uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M = uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M@52 @1665 + uFR_int_DesfireCreateLinearRecordFile_3k3des = uFR_int_DesfireCreateLinearRecordFile_3k3des@48 @1666 + uFR_int_DesfireCreateLinearRecordFile_3k3desM = uFR_int_DesfireCreateLinearRecordFile_3k3desM@52 @1667 + uFR_int_DesfireCreateLinearRecordFile_3k3des_PK = uFR_int_DesfireCreateLinearRecordFile_3k3des_PK@48 @1668 + uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M = uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M@52 @1669 + uFR_int_DesfireCreateLinearRecordFile_aes = uFR_int_DesfireCreateLinearRecordFile_aes@48 @1670 + uFR_int_DesfireCreateLinearRecordFile_aesM = uFR_int_DesfireCreateLinearRecordFile_aesM@52 @1671 + uFR_int_DesfireCreateLinearRecordFile_aes_PK = uFR_int_DesfireCreateLinearRecordFile_aes_PK@48 @1672 + uFR_int_DesfireCreateLinearRecordFile_aes_PK_M = uFR_int_DesfireCreateLinearRecordFile_aes_PK_M@52 @1673 + uFR_int_DesfireCreateLinearRecordFile_des = uFR_int_DesfireCreateLinearRecordFile_des@48 @1674 + uFR_int_DesfireCreateLinearRecordFile_desM = uFR_int_DesfireCreateLinearRecordFile_desM@52 @1675 + uFR_int_DesfireCreateLinearRecordFile_des_PK = uFR_int_DesfireCreateLinearRecordFile_des_PK@48 @1676 + uFR_int_DesfireCreateLinearRecordFile_des_PK_M = uFR_int_DesfireCreateLinearRecordFile_des_PK_M@52 @1677 + uFR_int_DesfireCreateLinearRecordFile_no_auth = uFR_int_DesfireCreateLinearRecordFile_no_auth@44 @1678 + uFR_int_DesfireCreateLinearRecordFile_no_authM = uFR_int_DesfireCreateLinearRecordFile_no_authM@48 @1679 + uFR_int_DesfireCreateStdDataFile = uFR_int_DesfireCreateStdDataFile@44 @1680 + uFR_int_DesfireCreateStdDataFileM = uFR_int_DesfireCreateStdDataFileM@48 @1681 + uFR_int_DesfireCreateStdDataFile_2k3des = uFR_int_DesfireCreateStdDataFile_2k3des@44 @1682 + uFR_int_DesfireCreateStdDataFile_2k3desM = uFR_int_DesfireCreateStdDataFile_2k3desM@48 @1683 + uFR_int_DesfireCreateStdDataFile_2k3des_PK = uFR_int_DesfireCreateStdDataFile_2k3des_PK@44 @1684 + uFR_int_DesfireCreateStdDataFile_2k3des_PK_M = uFR_int_DesfireCreateStdDataFile_2k3des_PK_M@48 @1685 + uFR_int_DesfireCreateStdDataFile_2k3des_iso = uFR_int_DesfireCreateStdDataFile_2k3des_iso@48 @1686 + uFR_int_DesfireCreateStdDataFile_2k3des_isoM = uFR_int_DesfireCreateStdDataFile_2k3des_isoM@52 @1687 + uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK = uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK@48 @1688 + uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M = uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M@52 @1689 + uFR_int_DesfireCreateStdDataFile_3k3des = uFR_int_DesfireCreateStdDataFile_3k3des@44 @1690 + uFR_int_DesfireCreateStdDataFile_3k3desM = uFR_int_DesfireCreateStdDataFile_3k3desM@48 @1691 + uFR_int_DesfireCreateStdDataFile_3k3des_PK = uFR_int_DesfireCreateStdDataFile_3k3des_PK@44 @1692 + uFR_int_DesfireCreateStdDataFile_3k3des_PK_M = uFR_int_DesfireCreateStdDataFile_3k3des_PK_M@48 @1693 + uFR_int_DesfireCreateStdDataFile_3k3des_iso = uFR_int_DesfireCreateStdDataFile_3k3des_iso@48 @1694 + uFR_int_DesfireCreateStdDataFile_3k3des_isoM = uFR_int_DesfireCreateStdDataFile_3k3des_isoM@52 @1695 + uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK = uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK@48 @1696 + uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M = uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M@52 @1697 + uFR_int_DesfireCreateStdDataFile_PK = uFR_int_DesfireCreateStdDataFile_PK@44 @1698 + uFR_int_DesfireCreateStdDataFile_PK_M = uFR_int_DesfireCreateStdDataFile_PK_M@48 @1699 + uFR_int_DesfireCreateStdDataFile_aes = uFR_int_DesfireCreateStdDataFile_aes@44 @1700 + uFR_int_DesfireCreateStdDataFile_aesM = uFR_int_DesfireCreateStdDataFile_aesM@48 @1701 + uFR_int_DesfireCreateStdDataFile_aes_PK = uFR_int_DesfireCreateStdDataFile_aes_PK@44 @1702 + uFR_int_DesfireCreateStdDataFile_aes_PK_M = uFR_int_DesfireCreateStdDataFile_aes_PK_M@48 @1703 + uFR_int_DesfireCreateStdDataFile_aes_iso = uFR_int_DesfireCreateStdDataFile_aes_iso@48 @1704 + uFR_int_DesfireCreateStdDataFile_aes_isoM = uFR_int_DesfireCreateStdDataFile_aes_isoM@52 @1705 + uFR_int_DesfireCreateStdDataFile_aes_iso_PK = uFR_int_DesfireCreateStdDataFile_aes_iso_PK@48 @1706 + uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M = uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M@52 @1707 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm = uFR_int_DesfireCreateStdDataFile_aes_iso_sdm@48 @1708 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM = uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM@52 @1709 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK = uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK@48 @1710 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M = uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M@52 @1711 + uFR_int_DesfireCreateStdDataFile_des = uFR_int_DesfireCreateStdDataFile_des@44 @1712 + uFR_int_DesfireCreateStdDataFile_desM = uFR_int_DesfireCreateStdDataFile_desM@48 @1713 + uFR_int_DesfireCreateStdDataFile_des_PK = uFR_int_DesfireCreateStdDataFile_des_PK@44 @1714 + uFR_int_DesfireCreateStdDataFile_des_PK_M = uFR_int_DesfireCreateStdDataFile_des_PK_M@48 @1715 + uFR_int_DesfireCreateStdDataFile_des_iso = uFR_int_DesfireCreateStdDataFile_des_iso@48 @1716 + uFR_int_DesfireCreateStdDataFile_des_isoM = uFR_int_DesfireCreateStdDataFile_des_isoM@52 @1717 + uFR_int_DesfireCreateStdDataFile_des_iso_PK = uFR_int_DesfireCreateStdDataFile_des_iso_PK@48 @1718 + uFR_int_DesfireCreateStdDataFile_des_iso_PK_M = uFR_int_DesfireCreateStdDataFile_des_iso_PK_M@52 @1719 + uFR_int_DesfireCreateStdDataFile_no_auth = uFR_int_DesfireCreateStdDataFile_no_auth@40 @1720 + uFR_int_DesfireCreateStdDataFile_no_auth_M = uFR_int_DesfireCreateStdDataFile_no_auth_M@44 @1721 + uFR_int_DesfireCreateStdDataFile_no_auth_iso = uFR_int_DesfireCreateStdDataFile_no_auth_iso@44 @1722 + uFR_int_DesfireCreateStdDataFile_no_auth_isoM = uFR_int_DesfireCreateStdDataFile_no_auth_isoM@48 @1723 + uFR_int_DesfireCreateTransMacFile_2k3des = uFR_int_DesfireCreateTransMacFile_2k3des@40 @1724 + uFR_int_DesfireCreateTransMacFile_2k3des_M = uFR_int_DesfireCreateTransMacFile_2k3des_M@44 @1725 + uFR_int_DesfireCreateTransMacFile_2k3des_PK = uFR_int_DesfireCreateTransMacFile_2k3des_PK@40 @1726 + uFR_int_DesfireCreateTransMacFile_2k3des_PK_M = uFR_int_DesfireCreateTransMacFile_2k3des_PK_M@44 @1727 + uFR_int_DesfireCreateTransMacFile_3k3des = uFR_int_DesfireCreateTransMacFile_3k3des@40 @1728 + uFR_int_DesfireCreateTransMacFile_3k3des_M = uFR_int_DesfireCreateTransMacFile_3k3des_M@44 @1729 + uFR_int_DesfireCreateTransMacFile_3k3des_PK = uFR_int_DesfireCreateTransMacFile_3k3des_PK@40 @1730 + uFR_int_DesfireCreateTransMacFile_3k3des_PK_M = uFR_int_DesfireCreateTransMacFile_3k3des_PK_M@44 @1731 + uFR_int_DesfireCreateTransMacFile_aes = uFR_int_DesfireCreateTransMacFile_aes@40 @1732 + uFR_int_DesfireCreateTransMacFile_aes_M = uFR_int_DesfireCreateTransMacFile_aes_M@44 @1733 + uFR_int_DesfireCreateTransMacFile_aes_PK = uFR_int_DesfireCreateTransMacFile_aes_PK@40 @1734 + uFR_int_DesfireCreateTransMacFile_aes_PK_M = uFR_int_DesfireCreateTransMacFile_aes_PK_M@44 @1735 + uFR_int_DesfireCreateTransMacFile_des = uFR_int_DesfireCreateTransMacFile_des@40 @1736 + uFR_int_DesfireCreateTransMacFile_des_M = uFR_int_DesfireCreateTransMacFile_des_M@44 @1737 + uFR_int_DesfireCreateTransMacFile_des_PK = uFR_int_DesfireCreateTransMacFile_des_PK@40 @1738 + uFR_int_DesfireCreateTransMacFile_des_PK_M = uFR_int_DesfireCreateTransMacFile_des_PK_M@44 @1739 + uFR_int_DesfireCreateValueFile = uFR_int_DesfireCreateValueFile@56 @1740 + uFR_int_DesfireCreateValueFileM = uFR_int_DesfireCreateValueFileM@60 @1741 + uFR_int_DesfireCreateValueFile_2k3des = uFR_int_DesfireCreateValueFile_2k3des@56 @1742 + uFR_int_DesfireCreateValueFile_2k3desM = uFR_int_DesfireCreateValueFile_2k3desM@60 @1743 + uFR_int_DesfireCreateValueFile_2k3des_PK = uFR_int_DesfireCreateValueFile_2k3des_PK@56 @1744 + uFR_int_DesfireCreateValueFile_2k3des_PK_M = uFR_int_DesfireCreateValueFile_2k3des_PK_M@60 @1745 + uFR_int_DesfireCreateValueFile_3k3des = uFR_int_DesfireCreateValueFile_3k3des@56 @1746 + uFR_int_DesfireCreateValueFile_3k3desM = uFR_int_DesfireCreateValueFile_3k3desM@60 @1747 + uFR_int_DesfireCreateValueFile_3k3des_PK = uFR_int_DesfireCreateValueFile_3k3des_PK@56 @1748 + uFR_int_DesfireCreateValueFile_3k3des_PK_M = uFR_int_DesfireCreateValueFile_3k3des_PK_M@60 @1749 + uFR_int_DesfireCreateValueFile_PK = uFR_int_DesfireCreateValueFile_PK@56 @1750 + uFR_int_DesfireCreateValueFile_PK_M = uFR_int_DesfireCreateValueFile_PK_M@60 @1751 + uFR_int_DesfireCreateValueFile_aes = uFR_int_DesfireCreateValueFile_aes@56 @1752 + uFR_int_DesfireCreateValueFile_aesM = uFR_int_DesfireCreateValueFile_aesM@60 @1753 + uFR_int_DesfireCreateValueFile_aes_PK = uFR_int_DesfireCreateValueFile_aes_PK@56 @1754 + uFR_int_DesfireCreateValueFile_aes_PK_M = uFR_int_DesfireCreateValueFile_aes_PK_M@60 @1755 + uFR_int_DesfireCreateValueFile_des = uFR_int_DesfireCreateValueFile_des@56 @1756 + uFR_int_DesfireCreateValueFile_desM = uFR_int_DesfireCreateValueFile_desM@60 @1757 + uFR_int_DesfireCreateValueFile_des_PK = uFR_int_DesfireCreateValueFile_des_PK@56 @1758 + uFR_int_DesfireCreateValueFile_des_PK_M = uFR_int_DesfireCreateValueFile_des_PK_M@60 @1759 + uFR_int_DesfireCreateValueFile_no_auth = uFR_int_DesfireCreateValueFile_no_auth@52 @1760 + uFR_int_DesfireCreateValueFile_no_auth_M = uFR_int_DesfireCreateValueFile_no_auth_M@56 @1761 + uFR_int_DesfireDecreaseValueFile = uFR_int_DesfireDecreaseValueFile@32 @1762 + uFR_int_DesfireDecreaseValueFileM = uFR_int_DesfireDecreaseValueFileM@36 @1763 + uFR_int_DesfireDecreaseValueFile_2k3des = uFR_int_DesfireDecreaseValueFile_2k3des@32 @1764 + uFR_int_DesfireDecreaseValueFile_2k3desM = uFR_int_DesfireDecreaseValueFile_2k3desM@36 @1765 + uFR_int_DesfireDecreaseValueFile_2k3des_PK = uFR_int_DesfireDecreaseValueFile_2k3des_PK@32 @1766 + uFR_int_DesfireDecreaseValueFile_2k3des_PK_M = uFR_int_DesfireDecreaseValueFile_2k3des_PK_M@36 @1767 + uFR_int_DesfireDecreaseValueFile_3k3des = uFR_int_DesfireDecreaseValueFile_3k3des@32 @1768 + uFR_int_DesfireDecreaseValueFile_3k3desM = uFR_int_DesfireDecreaseValueFile_3k3desM@36 @1769 + uFR_int_DesfireDecreaseValueFile_3k3des_PK = uFR_int_DesfireDecreaseValueFile_3k3des_PK@32 @1770 + uFR_int_DesfireDecreaseValueFile_3k3des_PK_M = uFR_int_DesfireDecreaseValueFile_3k3des_PK_M@36 @1771 + uFR_int_DesfireDecreaseValueFile_PK = uFR_int_DesfireDecreaseValueFile_PK@32 @1772 + uFR_int_DesfireDecreaseValueFile_PK_M = uFR_int_DesfireDecreaseValueFile_PK_M@36 @1773 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des = uFR_int_DesfireDecreaseValueFile_TransMac_2k3des@52 @1774 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM = uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM@56 @1775 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK = uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK@52 @1776 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M = uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M@56 @1777 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des = uFR_int_DesfireDecreaseValueFile_TransMac_3k3des@52 @1778 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM = uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM@56 @1779 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK = uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK@52 @1780 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M = uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M@56 @1781 + uFR_int_DesfireDecreaseValueFile_TransMac_aes = uFR_int_DesfireDecreaseValueFile_TransMac_aes@52 @1782 + uFR_int_DesfireDecreaseValueFile_TransMac_aesM = uFR_int_DesfireDecreaseValueFile_TransMac_aesM@56 @1783 + uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK = uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK@52 @1784 + uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M = uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M@56 @1785 + uFR_int_DesfireDecreaseValueFile_TransMac_des = uFR_int_DesfireDecreaseValueFile_TransMac_des@52 @1786 + uFR_int_DesfireDecreaseValueFile_TransMac_desM = uFR_int_DesfireDecreaseValueFile_TransMac_desM@56 @1787 + uFR_int_DesfireDecreaseValueFile_TransMac_des_PK = uFR_int_DesfireDecreaseValueFile_TransMac_des_PK@52 @1788 + uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M = uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M@56 @1789 + uFR_int_DesfireDecreaseValueFile_TransMac_no_auth = uFR_int_DesfireDecreaseValueFile_TransMac_no_auth@48 @1790 + uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M = uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M@52 @1791 + uFR_int_DesfireDecreaseValueFile_aes = uFR_int_DesfireDecreaseValueFile_aes@32 @1792 + uFR_int_DesfireDecreaseValueFile_aesM = uFR_int_DesfireDecreaseValueFile_aesM@36 @1793 + uFR_int_DesfireDecreaseValueFile_aes_PK = uFR_int_DesfireDecreaseValueFile_aes_PK@32 @1794 + uFR_int_DesfireDecreaseValueFile_aes_PK_M = uFR_int_DesfireDecreaseValueFile_aes_PK_M@36 @1795 + uFR_int_DesfireDecreaseValueFile_des = uFR_int_DesfireDecreaseValueFile_des@32 @1796 + uFR_int_DesfireDecreaseValueFile_desM = uFR_int_DesfireDecreaseValueFile_desM@36 @1797 + uFR_int_DesfireDecreaseValueFile_des_PK = uFR_int_DesfireDecreaseValueFile_des_PK@32 @1798 + uFR_int_DesfireDecreaseValueFile_des_PK_M = uFR_int_DesfireDecreaseValueFile_des_PK_M@36 @1799 + uFR_int_DesfireDecreaseValueFile_no_auth = uFR_int_DesfireDecreaseValueFile_no_auth@28 @1800 + uFR_int_DesfireDecreaseValueFile_no_auth_M = uFR_int_DesfireDecreaseValueFile_no_auth_M@32 @1801 + uFR_int_DesfireDeleteApplication = uFR_int_DesfireDeleteApplication@16 @1802 + uFR_int_DesfireDeleteApplicationM = uFR_int_DesfireDeleteApplicationM@20 @1803 + uFR_int_DesfireDeleteApplication_2k3des = uFR_int_DesfireDeleteApplication_2k3des@16 @1804 + uFR_int_DesfireDeleteApplication_2k3desM = uFR_int_DesfireDeleteApplication_2k3desM@20 @1805 + uFR_int_DesfireDeleteApplication_2k3des_PK = uFR_int_DesfireDeleteApplication_2k3des_PK@16 @1806 + uFR_int_DesfireDeleteApplication_2k3des_PK_M = uFR_int_DesfireDeleteApplication_2k3des_PK_M@20 @1807 + uFR_int_DesfireDeleteApplication_3k3des = uFR_int_DesfireDeleteApplication_3k3des@16 @1808 + uFR_int_DesfireDeleteApplication_3k3desM = uFR_int_DesfireDeleteApplication_3k3desM@20 @1809 + uFR_int_DesfireDeleteApplication_3k3des_PK = uFR_int_DesfireDeleteApplication_3k3des_PK@16 @1810 + uFR_int_DesfireDeleteApplication_3k3des_PK_M = uFR_int_DesfireDeleteApplication_3k3des_PK_M@20 @1811 + uFR_int_DesfireDeleteApplication_PK = uFR_int_DesfireDeleteApplication_PK@16 @1812 + uFR_int_DesfireDeleteApplication_PK_M = uFR_int_DesfireDeleteApplication_PK_M@20 @1813 + uFR_int_DesfireDeleteApplication_aes = uFR_int_DesfireDeleteApplication_aes@16 @1814 + uFR_int_DesfireDeleteApplication_aesM = uFR_int_DesfireDeleteApplication_aesM@20 @1815 + uFR_int_DesfireDeleteApplication_aes_PK = uFR_int_DesfireDeleteApplication_aes_PK@16 @1816 + uFR_int_DesfireDeleteApplication_aes_PK_M = uFR_int_DesfireDeleteApplication_aes_PK_M@20 @1817 + uFR_int_DesfireDeleteApplication_app_master_2k3des = uFR_int_DesfireDeleteApplication_app_master_2k3des@16 @1818 + uFR_int_DesfireDeleteApplication_app_master_2k3desM = uFR_int_DesfireDeleteApplication_app_master_2k3desM@20 @1819 + uFR_int_DesfireDeleteApplication_app_master_2k3des_PK = uFR_int_DesfireDeleteApplication_app_master_2k3des_PK@16 @1820 + uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M = uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M@20 @1821 + uFR_int_DesfireDeleteApplication_app_master_3k3des = uFR_int_DesfireDeleteApplication_app_master_3k3des@16 @1822 + uFR_int_DesfireDeleteApplication_app_master_3k3desM = uFR_int_DesfireDeleteApplication_app_master_3k3desM@20 @1823 + uFR_int_DesfireDeleteApplication_app_master_3k3des_PK = uFR_int_DesfireDeleteApplication_app_master_3k3des_PK@16 @1824 + uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M = uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M@20 @1825 + uFR_int_DesfireDeleteApplication_app_master_PK = uFR_int_DesfireDeleteApplication_app_master_PK@16 @1826 + uFR_int_DesfireDeleteApplication_app_master_aes = uFR_int_DesfireDeleteApplication_app_master_aes@16 @1827 + uFR_int_DesfireDeleteApplication_app_master_aesM = uFR_int_DesfireDeleteApplication_app_master_aesM@20 @1828 + uFR_int_DesfireDeleteApplication_app_master_aes_PK = uFR_int_DesfireDeleteApplication_app_master_aes_PK@16 @1829 + uFR_int_DesfireDeleteApplication_app_master_aes_PK_M = uFR_int_DesfireDeleteApplication_app_master_aes_PK_M@20 @1830 + uFR_int_DesfireDeleteApplication_app_master_des = uFR_int_DesfireDeleteApplication_app_master_des@16 @1831 + uFR_int_DesfireDeleteApplication_app_master_desM = uFR_int_DesfireDeleteApplication_app_master_desM@20 @1832 + uFR_int_DesfireDeleteApplication_app_master_des_PK = uFR_int_DesfireDeleteApplication_app_master_des_PK@16 @1833 + uFR_int_DesfireDeleteApplication_app_master_des_PK_M = uFR_int_DesfireDeleteApplication_app_master_des_PK_M@20 @1834 + uFR_int_DesfireDeleteApplication_des = uFR_int_DesfireDeleteApplication_des@16 @1835 + uFR_int_DesfireDeleteApplication_desM = uFR_int_DesfireDeleteApplication_desM@20 @1836 + uFR_int_DesfireDeleteApplication_des_PK = uFR_int_DesfireDeleteApplication_des_PK@16 @1837 + uFR_int_DesfireDeleteApplication_des_PK_M = uFR_int_DesfireDeleteApplication_des_PK_M@20 @1838 + uFR_int_DesfireDeleteFile = uFR_int_DesfireDeleteFile@20 @1839 + uFR_int_DesfireDeleteFileM = uFR_int_DesfireDeleteFileM@24 @1840 + uFR_int_DesfireDeleteFile_2k3des = uFR_int_DesfireDeleteFile_2k3des@20 @1841 + uFR_int_DesfireDeleteFile_2k3desM = uFR_int_DesfireDeleteFile_2k3desM@24 @1842 + uFR_int_DesfireDeleteFile_2k3des_PK = uFR_int_DesfireDeleteFile_2k3des_PK@20 @1843 + uFR_int_DesfireDeleteFile_2k3des_PK_M = uFR_int_DesfireDeleteFile_2k3des_PK_M@24 @1844 + uFR_int_DesfireDeleteFile_3k3des = uFR_int_DesfireDeleteFile_3k3des@20 @1845 + uFR_int_DesfireDeleteFile_3k3desM = uFR_int_DesfireDeleteFile_3k3desM@24 @1846 + uFR_int_DesfireDeleteFile_3k3des_PK = uFR_int_DesfireDeleteFile_3k3des_PK@20 @1847 + uFR_int_DesfireDeleteFile_3k3des_PK_M = uFR_int_DesfireDeleteFile_3k3des_PK_M@24 @1848 + uFR_int_DesfireDeleteFile_PK = uFR_int_DesfireDeleteFile_PK@20 @1849 + uFR_int_DesfireDeleteFile_PK_M = uFR_int_DesfireDeleteFile_PK_M@24 @1850 + uFR_int_DesfireDeleteFile_aes = uFR_int_DesfireDeleteFile_aes@20 @1851 + uFR_int_DesfireDeleteFile_aesM = uFR_int_DesfireDeleteFile_aesM@24 @1852 + uFR_int_DesfireDeleteFile_aes_PK = uFR_int_DesfireDeleteFile_aes_PK@20 @1853 + uFR_int_DesfireDeleteFile_aes_PK_M = uFR_int_DesfireDeleteFile_aes_PK_M@24 @1854 + uFR_int_DesfireDeleteFile_des = uFR_int_DesfireDeleteFile_des@20 @1855 + uFR_int_DesfireDeleteFile_desM = uFR_int_DesfireDeleteFile_desM@24 @1856 + uFR_int_DesfireDeleteFile_des_PK = uFR_int_DesfireDeleteFile_des_PK@20 @1857 + uFR_int_DesfireDeleteFile_des_PK_M = uFR_int_DesfireDeleteFile_des_PK_M@24 @1858 + uFR_int_DesfireDeleteFile_no_auth = uFR_int_DesfireDeleteFile_no_auth@16 @1859 + uFR_int_DesfireDeleteFile_no_auth_M = uFR_int_DesfireDeleteFile_no_auth_M@20 @1860 + uFR_int_DesfireFormatCard = uFR_int_DesfireFormatCard@12 @1861 + uFR_int_DesfireFormatCardM = uFR_int_DesfireFormatCardM@16 @1862 + uFR_int_DesfireFormatCard_2k3des = uFR_int_DesfireFormatCard_2k3des@12 @1863 + uFR_int_DesfireFormatCard_2k3desM = uFR_int_DesfireFormatCard_2k3desM@16 @1864 + uFR_int_DesfireFormatCard_2k3des_PK = uFR_int_DesfireFormatCard_2k3des_PK@12 @1865 + uFR_int_DesfireFormatCard_2k3des_PK_M = uFR_int_DesfireFormatCard_2k3des_PK_M@16 @1866 + uFR_int_DesfireFormatCard_3k3des = uFR_int_DesfireFormatCard_3k3des@12 @1867 + uFR_int_DesfireFormatCard_3k3desM = uFR_int_DesfireFormatCard_3k3desM@16 @1868 + uFR_int_DesfireFormatCard_3k3des_PK = uFR_int_DesfireFormatCard_3k3des_PK@12 @1869 + uFR_int_DesfireFormatCard_3k3des_PK_M = uFR_int_DesfireFormatCard_3k3des_PK_M@16 @1870 + uFR_int_DesfireFormatCard_PK = uFR_int_DesfireFormatCard_PK@12 @1871 + uFR_int_DesfireFormatCard_PK_M = uFR_int_DesfireFormatCard_PK_M@16 @1872 + uFR_int_DesfireFormatCard_aes = uFR_int_DesfireFormatCard_aes@12 @1873 + uFR_int_DesfireFormatCard_aesM = uFR_int_DesfireFormatCard_aesM@16 @1874 + uFR_int_DesfireFormatCard_aes_PK = uFR_int_DesfireFormatCard_aes_PK@12 @1875 + uFR_int_DesfireFormatCard_aes_PK_M = uFR_int_DesfireFormatCard_aes_PK_M@16 @1876 + uFR_int_DesfireFormatCard_des = uFR_int_DesfireFormatCard_des@12 @1877 + uFR_int_DesfireFormatCard_desM = uFR_int_DesfireFormatCard_desM@16 @1878 + uFR_int_DesfireFormatCard_des_PK = uFR_int_DesfireFormatCard_des_PK@12 @1879 + uFR_int_DesfireFormatCard_des_PK_M = uFR_int_DesfireFormatCard_des_PK_M@16 @1880 + uFR_int_DesfireFreeMem = uFR_int_DesfireFreeMem@12 @1881 + uFR_int_DesfireFreeMemM = uFR_int_DesfireFreeMemM@16 @1882 + uFR_int_DesfireGetApplicationIds = uFR_int_DesfireGetApplicationIds@20 @1883 + uFR_int_DesfireGetApplicationIdsM = uFR_int_DesfireGetApplicationIdsM@24 @1884 + uFR_int_DesfireGetApplicationIds_2k3des = uFR_int_DesfireGetApplicationIds_2k3des@20 @1885 + uFR_int_DesfireGetApplicationIds_2k3desM = uFR_int_DesfireGetApplicationIds_2k3desM@24 @1886 + uFR_int_DesfireGetApplicationIds_2k3des_PK = uFR_int_DesfireGetApplicationIds_2k3des_PK@20 @1887 + uFR_int_DesfireGetApplicationIds_2k3des_PK_M = uFR_int_DesfireGetApplicationIds_2k3des_PK_M@24 @1888 + uFR_int_DesfireGetApplicationIds_3k3des = uFR_int_DesfireGetApplicationIds_3k3des@20 @1889 + uFR_int_DesfireGetApplicationIds_3k3desM = uFR_int_DesfireGetApplicationIds_3k3desM@24 @1890 + uFR_int_DesfireGetApplicationIds_3k3des_PK = uFR_int_DesfireGetApplicationIds_3k3des_PK@20 @1891 + uFR_int_DesfireGetApplicationIds_3k3des_PK_M = uFR_int_DesfireGetApplicationIds_3k3des_PK_M@24 @1892 + uFR_int_DesfireGetApplicationIds_PK = uFR_int_DesfireGetApplicationIds_PK@20 @1893 + uFR_int_DesfireGetApplicationIds_PK_M = uFR_int_DesfireGetApplicationIds_PK_M@24 @1894 + uFR_int_DesfireGetApplicationIds_aes = uFR_int_DesfireGetApplicationIds_aes@20 @1895 + uFR_int_DesfireGetApplicationIds_aesM = uFR_int_DesfireGetApplicationIds_aesM@24 @1896 + uFR_int_DesfireGetApplicationIds_aes_PK = uFR_int_DesfireGetApplicationIds_aes_PK@20 @1897 + uFR_int_DesfireGetApplicationIds_aes_PK_M = uFR_int_DesfireGetApplicationIds_aes_PK_M@24 @1898 + uFR_int_DesfireGetApplicationIds_des = uFR_int_DesfireGetApplicationIds_des@20 @1899 + uFR_int_DesfireGetApplicationIds_desM = uFR_int_DesfireGetApplicationIds_desM@24 @1900 + uFR_int_DesfireGetApplicationIds_des_PK = uFR_int_DesfireGetApplicationIds_des_PK@20 @1901 + uFR_int_DesfireGetApplicationIds_des_PK_M = uFR_int_DesfireGetApplicationIds_des_PK_M@24 @1902 + uFR_int_DesfireGetApplicationIds_no_auth = uFR_int_DesfireGetApplicationIds_no_auth@16 @1903 + uFR_int_DesfireGetApplicationIds_no_auth_M = uFR_int_DesfireGetApplicationIds_no_auth_M@20 @1904 + uFR_int_DesfireGetFileSettingsSdm_aes = uFR_int_DesfireGetFileSettingsSdm_aes@112 @1905 + uFR_int_DesfireGetFileSettingsSdm_aes_M = uFR_int_DesfireGetFileSettingsSdm_aes_M@116 @1906 + uFR_int_DesfireGetFileSettingsSdm_aes_PK = uFR_int_DesfireGetFileSettingsSdm_aes_PK@112 @1907 + uFR_int_DesfireGetFileSettingsSdm_aes_PK_M = uFR_int_DesfireGetFileSettingsSdm_aes_PK_M@116 @1908 + uFR_int_DesfireGetFileSettings_2k3des = uFR_int_DesfireGetFileSettings_2k3des@84 @1909 + uFR_int_DesfireGetFileSettings_2k3des_M = uFR_int_DesfireGetFileSettings_2k3des_M@88 @1910 + uFR_int_DesfireGetFileSettings_2k3des_PK = uFR_int_DesfireGetFileSettings_2k3des_PK@84 @1911 + uFR_int_DesfireGetFileSettings_2k3des_PK_M = uFR_int_DesfireGetFileSettings_2k3des_PK_M@88 @1912 + uFR_int_DesfireGetFileSettings_3k3des = uFR_int_DesfireGetFileSettings_3k3des@84 @1913 + uFR_int_DesfireGetFileSettings_3k3des_M = uFR_int_DesfireGetFileSettings_3k3des_M@88 @1914 + uFR_int_DesfireGetFileSettings_3k3des_PK = uFR_int_DesfireGetFileSettings_3k3des_PK@84 @1915 + uFR_int_DesfireGetFileSettings_3k3des_PK_M = uFR_int_DesfireGetFileSettings_3k3des_PK_M@88 @1916 + uFR_int_DesfireGetFileSettings_aes = uFR_int_DesfireGetFileSettings_aes@84 @1917 + uFR_int_DesfireGetFileSettings_aes_M = uFR_int_DesfireGetFileSettings_aes_M@88 @1918 + uFR_int_DesfireGetFileSettings_aes_PK = uFR_int_DesfireGetFileSettings_aes_PK@84 @1919 + uFR_int_DesfireGetFileSettings_aes_PK_M = uFR_int_DesfireGetFileSettings_aes_PK_M@88 @1920 + uFR_int_DesfireGetFileSettings_des = uFR_int_DesfireGetFileSettings_des@84 @1921 + uFR_int_DesfireGetFileSettings_des_M = uFR_int_DesfireGetFileSettings_des_M@88 @1922 + uFR_int_DesfireGetFileSettings_des_PK = uFR_int_DesfireGetFileSettings_des_PK@84 @1923 + uFR_int_DesfireGetFileSettings_des_PK_M = uFR_int_DesfireGetFileSettings_des_PK_M@88 @1924 + uFR_int_DesfireGetFileSettings_no_auth = uFR_int_DesfireGetFileSettings_no_auth@80 @1925 + uFR_int_DesfireGetFileSettings_no_auth_M = uFR_int_DesfireGetFileSettings_no_auth_M@84 @1926 + uFR_int_DesfireGetKeySettings = uFR_int_DesfireGetKeySettings@24 @1927 + uFR_int_DesfireGetKeySettingsM = uFR_int_DesfireGetKeySettingsM@28 @1928 + uFR_int_DesfireGetKeySettings_2k3des = uFR_int_DesfireGetKeySettings_2k3des@24 @1929 + uFR_int_DesfireGetKeySettings_2k3desM = uFR_int_DesfireGetKeySettings_2k3desM@28 @1930 + uFR_int_DesfireGetKeySettings_2k3des_PK = uFR_int_DesfireGetKeySettings_2k3des_PK@24 @1931 + uFR_int_DesfireGetKeySettings_2k3des_PK_M = uFR_int_DesfireGetKeySettings_2k3des_PK_M@28 @1932 + uFR_int_DesfireGetKeySettings_3k3des = uFR_int_DesfireGetKeySettings_3k3des@24 @1933 + uFR_int_DesfireGetKeySettings_3k3desM = uFR_int_DesfireGetKeySettings_3k3desM@28 @1934 + uFR_int_DesfireGetKeySettings_3k3des_PK = uFR_int_DesfireGetKeySettings_3k3des_PK@24 @1935 + uFR_int_DesfireGetKeySettings_3k3des_PK_M = uFR_int_DesfireGetKeySettings_3k3des_PK_M@28 @1936 + uFR_int_DesfireGetKeySettings_PK = uFR_int_DesfireGetKeySettings_PK@24 @1937 + uFR_int_DesfireGetKeySettings_PK_M = uFR_int_DesfireGetKeySettings_PK_M@28 @1938 + uFR_int_DesfireGetKeySettings_aes = uFR_int_DesfireGetKeySettings_aes@24 @1939 + uFR_int_DesfireGetKeySettings_aesM = uFR_int_DesfireGetKeySettings_aesM@28 @1940 + uFR_int_DesfireGetKeySettings_aes_PK = uFR_int_DesfireGetKeySettings_aes_PK@24 @1941 + uFR_int_DesfireGetKeySettings_aes_PK_M = uFR_int_DesfireGetKeySettings_aes_PK_M@28 @1942 + uFR_int_DesfireGetKeySettings_des = uFR_int_DesfireGetKeySettings_des@24 @1943 + uFR_int_DesfireGetKeySettings_desM = uFR_int_DesfireGetKeySettings_desM@28 @1944 + uFR_int_DesfireGetKeySettings_des_PK = uFR_int_DesfireGetKeySettings_des_PK@24 @1945 + uFR_int_DesfireGetKeySettings_des_PK_M = uFR_int_DesfireGetKeySettings_des_PK_M@28 @1946 + uFR_int_DesfireGetKeySettings_no_auth = uFR_int_DesfireGetKeySettings_no_auth@20 @1947 + uFR_int_DesfireGetKeySettings_no_auth_M = uFR_int_DesfireGetKeySettings_no_auth_M@24 @1948 + uFR_int_DesfireGetStdFileSize_2k3des = uFR_int_DesfireGetStdFileSize_2k3des@24 @1949 + uFR_int_DesfireGetStdFileSize_2k3des_M = uFR_int_DesfireGetStdFileSize_2k3des_M@28 @1950 + uFR_int_DesfireGetStdFileSize_2k3des_PK = uFR_int_DesfireGetStdFileSize_2k3des_PK@24 @1951 + uFR_int_DesfireGetStdFileSize_2k3des_PK_M = uFR_int_DesfireGetStdFileSize_2k3des_PK_M@28 @1952 + uFR_int_DesfireGetStdFileSize_3k3des = uFR_int_DesfireGetStdFileSize_3k3des@24 @1953 + uFR_int_DesfireGetStdFileSize_3k3des_M = uFR_int_DesfireGetStdFileSize_3k3des_M@28 @1954 + uFR_int_DesfireGetStdFileSize_3k3des_PK = uFR_int_DesfireGetStdFileSize_3k3des_PK@24 @1955 + uFR_int_DesfireGetStdFileSize_3k3des_PK_M = uFR_int_DesfireGetStdFileSize_3k3des_PK_M@28 @1956 + uFR_int_DesfireGetStdFileSize_aes = uFR_int_DesfireGetStdFileSize_aes@24 @1957 + uFR_int_DesfireGetStdFileSize_aes_M = uFR_int_DesfireGetStdFileSize_aes_M@28 @1958 + uFR_int_DesfireGetStdFileSize_aes_PK = uFR_int_DesfireGetStdFileSize_aes_PK@24 @1959 + uFR_int_DesfireGetStdFileSize_aes_PK_M = uFR_int_DesfireGetStdFileSize_aes_PK_M@28 @1960 + uFR_int_DesfireGetStdFileSize_des = uFR_int_DesfireGetStdFileSize_des@24 @1961 + uFR_int_DesfireGetStdFileSize_des_M = uFR_int_DesfireGetStdFileSize_des_M@28 @1962 + uFR_int_DesfireGetStdFileSize_des_PK = uFR_int_DesfireGetStdFileSize_des_PK@24 @1963 + uFR_int_DesfireGetStdFileSize_des_PK_M = uFR_int_DesfireGetStdFileSize_des_PK_M@28 @1964 + uFR_int_DesfireGetStdFileSize_no_auth = uFR_int_DesfireGetStdFileSize_no_auth@20 @1965 + uFR_int_DesfireGetStdFileSize_no_auth_M = uFR_int_DesfireGetStdFileSize_no_auth_M@24 @1966 + uFR_int_DesfireIncreaseValueFile = uFR_int_DesfireIncreaseValueFile@32 @1967 + uFR_int_DesfireIncreaseValueFileM = uFR_int_DesfireIncreaseValueFileM@36 @1968 + uFR_int_DesfireIncreaseValueFile_2k3des = uFR_int_DesfireIncreaseValueFile_2k3des@32 @1969 + uFR_int_DesfireIncreaseValueFile_2k3desM = uFR_int_DesfireIncreaseValueFile_2k3desM@36 @1970 + uFR_int_DesfireIncreaseValueFile_2k3des_PK = uFR_int_DesfireIncreaseValueFile_2k3des_PK@32 @1971 + uFR_int_DesfireIncreaseValueFile_2k3des_PK_M = uFR_int_DesfireIncreaseValueFile_2k3des_PK_M@36 @1972 + uFR_int_DesfireIncreaseValueFile_3k3des = uFR_int_DesfireIncreaseValueFile_3k3des@32 @1973 + uFR_int_DesfireIncreaseValueFile_3k3desM = uFR_int_DesfireIncreaseValueFile_3k3desM@36 @1974 + uFR_int_DesfireIncreaseValueFile_3k3des_PK = uFR_int_DesfireIncreaseValueFile_3k3des_PK@32 @1975 + uFR_int_DesfireIncreaseValueFile_3k3des_PK_M = uFR_int_DesfireIncreaseValueFile_3k3des_PK_M@36 @1976 + uFR_int_DesfireIncreaseValueFile_PK = uFR_int_DesfireIncreaseValueFile_PK@32 @1977 + uFR_int_DesfireIncreaseValueFile_PK_M = uFR_int_DesfireIncreaseValueFile_PK_M@36 @1978 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des = uFR_int_DesfireIncreaseValueFile_TransMac_2k3des@52 @1979 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM = uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM@56 @1980 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK = uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK@52 @1981 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M = uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M@56 @1982 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des = uFR_int_DesfireIncreaseValueFile_TransMac_3k3des@52 @1983 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM = uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM@56 @1984 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK = uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK@52 @1985 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M = uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M@56 @1986 + uFR_int_DesfireIncreaseValueFile_TransMac_aes = uFR_int_DesfireIncreaseValueFile_TransMac_aes@52 @1987 + uFR_int_DesfireIncreaseValueFile_TransMac_aesM = uFR_int_DesfireIncreaseValueFile_TransMac_aesM@56 @1988 + uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK = uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK@52 @1989 + uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M = uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M@56 @1990 + uFR_int_DesfireIncreaseValueFile_TransMac_des = uFR_int_DesfireIncreaseValueFile_TransMac_des@52 @1991 + uFR_int_DesfireIncreaseValueFile_TransMac_desM = uFR_int_DesfireIncreaseValueFile_TransMac_desM@56 @1992 + uFR_int_DesfireIncreaseValueFile_TransMac_des_PK = uFR_int_DesfireIncreaseValueFile_TransMac_des_PK@52 @1993 + uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M = uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M@56 @1994 + uFR_int_DesfireIncreaseValueFile_TransMac_no_auth = uFR_int_DesfireIncreaseValueFile_TransMac_no_auth@48 @1995 + uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M = uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M@52 @1996 + uFR_int_DesfireIncreaseValueFile_aes = uFR_int_DesfireIncreaseValueFile_aes@32 @1997 + uFR_int_DesfireIncreaseValueFile_aesM = uFR_int_DesfireIncreaseValueFile_aesM@36 @1998 + uFR_int_DesfireIncreaseValueFile_aes_PK = uFR_int_DesfireIncreaseValueFile_aes_PK@32 @1999 + uFR_int_DesfireIncreaseValueFile_aes_PK_M = uFR_int_DesfireIncreaseValueFile_aes_PK_M@36 @2000 + uFR_int_DesfireIncreaseValueFile_des = uFR_int_DesfireIncreaseValueFile_des@32 @2001 + uFR_int_DesfireIncreaseValueFile_desM = uFR_int_DesfireIncreaseValueFile_desM@36 @2002 + uFR_int_DesfireIncreaseValueFile_des_PK = uFR_int_DesfireIncreaseValueFile_des_PK@32 @2003 + uFR_int_DesfireIncreaseValueFile_des_PK_M = uFR_int_DesfireIncreaseValueFile_des_PK_M@36 @2004 + uFR_int_DesfireIncreaseValueFile_no_auth = uFR_int_DesfireIncreaseValueFile_no_auth@28 @2005 + uFR_int_DesfireIncreaseValueFile_no_auth_M = uFR_int_DesfireIncreaseValueFile_no_auth_M@32 @2006 + uFR_int_DesfireNDEFFormat = uFR_int_DesfireNDEFFormat@4 @2007 + uFR_int_DesfireReadNDEFMessage = uFR_int_DesfireReadNDEFMessage@8 @2008 + uFR_int_DesfireReadNDEFPayload = uFR_int_DesfireReadNDEFPayload@4 @2009 + uFR_int_DesfireReadRecords_2k3des = uFR_int_DesfireReadRecords_2k3des@44 @2010 + uFR_int_DesfireReadRecords_2k3desM = uFR_int_DesfireReadRecords_2k3desM@48 @2011 + uFR_int_DesfireReadRecords_2k3des_PK = uFR_int_DesfireReadRecords_2k3des_PK@44 @2012 + uFR_int_DesfireReadRecords_2k3des_PK_M = uFR_int_DesfireReadRecords_2k3des_PK_M@48 @2013 + uFR_int_DesfireReadRecords_3k3des = uFR_int_DesfireReadRecords_3k3des@44 @2014 + uFR_int_DesfireReadRecords_3k3desM = uFR_int_DesfireReadRecords_3k3desM@48 @2015 + uFR_int_DesfireReadRecords_3k3des_PK = uFR_int_DesfireReadRecords_3k3des_PK@44 @2016 + uFR_int_DesfireReadRecords_3k3des_PK_M = uFR_int_DesfireReadRecords_3k3des_PK_M@48 @2017 + uFR_int_DesfireReadRecords_aes = uFR_int_DesfireReadRecords_aes@44 @2018 + uFR_int_DesfireReadRecords_aesM = uFR_int_DesfireReadRecords_aesM@48 @2019 + uFR_int_DesfireReadRecords_aes_PK = uFR_int_DesfireReadRecords_aes_PK@44 @2020 + uFR_int_DesfireReadRecords_aes_PK_M = uFR_int_DesfireReadRecords_aes_PK_M@48 @2021 + uFR_int_DesfireReadRecords_des = uFR_int_DesfireReadRecords_des@44 @2022 + uFR_int_DesfireReadRecords_desM = uFR_int_DesfireReadRecords_desM@48 @2023 + uFR_int_DesfireReadRecords_des_PK = uFR_int_DesfireReadRecords_des_PK@44 @2024 + uFR_int_DesfireReadRecords_des_PK_M = uFR_int_DesfireReadRecords_des_PK_M@48 @2025 + uFR_int_DesfireReadRecords_no_auth = uFR_int_DesfireReadRecords_no_auth@40 @2026 + uFR_int_DesfireReadRecords_no_authM = uFR_int_DesfireReadRecords_no_authM@44 @2027 + uFR_int_DesfireReadStdDataFile = uFR_int_DesfireReadStdDataFile@40 @2028 + uFR_int_DesfireReadStdDataFile_2k3des = uFR_int_DesfireReadStdDataFile_2k3des@40 @2029 + uFR_int_DesfireReadStdDataFile_2k3desM = uFR_int_DesfireReadStdDataFile_2k3desM@44 @2030 + uFR_int_DesfireReadStdDataFile_2k3des_PK = uFR_int_DesfireReadStdDataFile_2k3des_PK@40 @2031 + uFR_int_DesfireReadStdDataFile_2k3des_PK_M = uFR_int_DesfireReadStdDataFile_2k3des_PK_M@44 @2032 + uFR_int_DesfireReadStdDataFile_3k3des = uFR_int_DesfireReadStdDataFile_3k3des@40 @2033 + uFR_int_DesfireReadStdDataFile_3k3desM = uFR_int_DesfireReadStdDataFile_3k3desM@44 @2034 + uFR_int_DesfireReadStdDataFile_3k3des_PK = uFR_int_DesfireReadStdDataFile_3k3des_PK@40 @2035 + uFR_int_DesfireReadStdDataFile_3k3des_PK_M = uFR_int_DesfireReadStdDataFile_3k3des_PK_M@44 @2036 + uFR_int_DesfireReadStdDataFile_PK = uFR_int_DesfireReadStdDataFile_PK@40 @2037 + uFR_int_DesfireReadStdDataFile_PK_M = uFR_int_DesfireReadStdDataFile_PK_M@44 @2038 + uFR_int_DesfireReadStdDataFile_aes = uFR_int_DesfireReadStdDataFile_aes@40 @2039 + uFR_int_DesfireReadStdDataFile_aesM = uFR_int_DesfireReadStdDataFile_aesM@44 @2040 + uFR_int_DesfireReadStdDataFile_aes_PK = uFR_int_DesfireReadStdDataFile_aes_PK@40 @2041 + uFR_int_DesfireReadStdDataFile_aes_PK_M = uFR_int_DesfireReadStdDataFile_aes_PK_M@44 @2042 + uFR_int_DesfireReadStdDataFile_des = uFR_int_DesfireReadStdDataFile_des@40 @2043 + uFR_int_DesfireReadStdDataFile_desM = uFR_int_DesfireReadStdDataFile_desM@44 @2044 + uFR_int_DesfireReadStdDataFile_des_PK = uFR_int_DesfireReadStdDataFile_des_PK@40 @2045 + uFR_int_DesfireReadStdDataFile_des_PK_M = uFR_int_DesfireReadStdDataFile_des_PK_M@44 @2046 + uFR_int_DesfireReadStdDataFile_no_auth = uFR_int_DesfireReadStdDataFile_no_auth@36 @2047 + uFR_int_DesfireReadStdDataFile_no_auth_M = uFR_int_DesfireReadStdDataFile_no_auth_M@40 @2048 + uFR_int_DesfireReadStddDataFileM = uFR_int_DesfireReadStddDataFileM@44 @2049 + uFR_int_DesfireReadStddDataFile_aesM = uFR_int_DesfireReadStddDataFile_aesM@44 @2050 + uFR_int_DesfireReadValueFile = uFR_int_DesfireReadValueFile@32 @2051 + uFR_int_DesfireReadValueFileM = uFR_int_DesfireReadValueFileM@36 @2052 + uFR_int_DesfireReadValueFile_2k3des = uFR_int_DesfireReadValueFile_2k3des@32 @2053 + uFR_int_DesfireReadValueFile_2k3desM = uFR_int_DesfireReadValueFile_2k3desM@36 @2054 + uFR_int_DesfireReadValueFile_2k3des_PK = uFR_int_DesfireReadValueFile_2k3des_PK@32 @2055 + uFR_int_DesfireReadValueFile_2k3des_PK_M = uFR_int_DesfireReadValueFile_2k3des_PK_M@36 @2056 + uFR_int_DesfireReadValueFile_3k3des = uFR_int_DesfireReadValueFile_3k3des@32 @2057 + uFR_int_DesfireReadValueFile_3k3desM = uFR_int_DesfireReadValueFile_3k3desM@36 @2058 + uFR_int_DesfireReadValueFile_3k3des_PK = uFR_int_DesfireReadValueFile_3k3des_PK@32 @2059 + uFR_int_DesfireReadValueFile_3k3des_PK_M = uFR_int_DesfireReadValueFile_3k3des_PK_M@36 @2060 + uFR_int_DesfireReadValueFile_PK = uFR_int_DesfireReadValueFile_PK@32 @2061 + uFR_int_DesfireReadValueFile_PK_M = uFR_int_DesfireReadValueFile_PK_M@36 @2062 + uFR_int_DesfireReadValueFile_aes = uFR_int_DesfireReadValueFile_aes@32 @2063 + uFR_int_DesfireReadValueFile_aesM = uFR_int_DesfireReadValueFile_aesM@36 @2064 + uFR_int_DesfireReadValueFile_aes_PK = uFR_int_DesfireReadValueFile_aes_PK@32 @2065 + uFR_int_DesfireReadValueFile_aes_PK_M = uFR_int_DesfireReadValueFile_aes_PK_M@36 @2066 + uFR_int_DesfireReadValueFile_des = uFR_int_DesfireReadValueFile_des@32 @2067 + uFR_int_DesfireReadValueFile_desM = uFR_int_DesfireReadValueFile_desM@36 @2068 + uFR_int_DesfireReadValueFile_des_PK = uFR_int_DesfireReadValueFile_des_PK@32 @2069 + uFR_int_DesfireReadValueFile_des_PK_M = uFR_int_DesfireReadValueFile_des_PK_M@36 @2070 + uFR_int_DesfireReadValueFile_no_auth = uFR_int_DesfireReadValueFile_no_auth@28 @2071 + uFR_int_DesfireReadValueFile_no_auth_M = uFR_int_DesfireReadValueFile_no_auth_M@32 @2072 + uFR_int_DesfireRidReadECCSignature_2k3des = uFR_int_DesfireRidReadECCSignature_2k3des@24 @2073 + uFR_int_DesfireRidReadECCSignature_2k3desM = uFR_int_DesfireRidReadECCSignature_2k3desM@28 @2074 + uFR_int_DesfireRidReadECCSignature_2k3des_PK = uFR_int_DesfireRidReadECCSignature_2k3des_PK@24 @2075 + uFR_int_DesfireRidReadECCSignature_2k3des_PK_M = uFR_int_DesfireRidReadECCSignature_2k3des_PK_M@28 @2076 + uFR_int_DesfireRidReadECCSignature_3k3des = uFR_int_DesfireRidReadECCSignature_3k3des@24 @2077 + uFR_int_DesfireRidReadECCSignature_3k3desM = uFR_int_DesfireRidReadECCSignature_3k3desM@28 @2078 + uFR_int_DesfireRidReadECCSignature_3k3des_PK = uFR_int_DesfireRidReadECCSignature_3k3des_PK@24 @2079 + uFR_int_DesfireRidReadECCSignature_3k3des_PK_M = uFR_int_DesfireRidReadECCSignature_3k3des_PK_M@28 @2080 + uFR_int_DesfireRidReadECCSignature_aes = uFR_int_DesfireRidReadECCSignature_aes@24 @2081 + uFR_int_DesfireRidReadECCSignature_aesM = uFR_int_DesfireRidReadECCSignature_aesM@28 @2082 + uFR_int_DesfireRidReadECCSignature_aes_PK = uFR_int_DesfireRidReadECCSignature_aes_PK@24 @2083 + uFR_int_DesfireRidReadECCSignature_aes_PK_M = uFR_int_DesfireRidReadECCSignature_aes_PK_M@28 @2084 + uFR_int_DesfireRidReadECCSignature_des = uFR_int_DesfireRidReadECCSignature_des@24 @2085 + uFR_int_DesfireRidReadECCSignature_desM = uFR_int_DesfireRidReadECCSignature_desM@28 @2086 + uFR_int_DesfireRidReadECCSignature_des_PK = uFR_int_DesfireRidReadECCSignature_des_PK@24 @2087 + uFR_int_DesfireRidReadECCSignature_des_PK_M = uFR_int_DesfireRidReadECCSignature_des_PK_M@28 @2088 + uFR_int_DesfireSetConfiguration = uFR_int_DesfireSetConfiguration@20 @2089 + uFR_int_DesfireSetConfigurationM = uFR_int_DesfireSetConfigurationM@24 @2090 + uFR_int_DesfireSetConfiguration_2k3des = uFR_int_DesfireSetConfiguration_2k3des@20 @2091 + uFR_int_DesfireSetConfiguration_2k3desM = uFR_int_DesfireSetConfiguration_2k3desM@24 @2092 + uFR_int_DesfireSetConfiguration_2k3des_PK = uFR_int_DesfireSetConfiguration_2k3des_PK@20 @2093 + uFR_int_DesfireSetConfiguration_2k3des_PK_M = uFR_int_DesfireSetConfiguration_2k3des_PK_M@24 @2094 + uFR_int_DesfireSetConfiguration_3k3des = uFR_int_DesfireSetConfiguration_3k3des@20 @2095 + uFR_int_DesfireSetConfiguration_3k3desM = uFR_int_DesfireSetConfiguration_3k3desM@24 @2096 + uFR_int_DesfireSetConfiguration_3k3des_PK = uFR_int_DesfireSetConfiguration_3k3des_PK@20 @2097 + uFR_int_DesfireSetConfiguration_3k3des_PK_M = uFR_int_DesfireSetConfiguration_3k3des_PK_M@24 @2098 + uFR_int_DesfireSetConfiguration_PK = uFR_int_DesfireSetConfiguration_PK@20 @2099 + uFR_int_DesfireSetConfiguration_PK_M = uFR_int_DesfireSetConfiguration_PK_M@24 @2100 + uFR_int_DesfireSetConfiguration_aes = uFR_int_DesfireSetConfiguration_aes@20 @2101 + uFR_int_DesfireSetConfiguration_aesM = uFR_int_DesfireSetConfiguration_aesM@24 @2102 + uFR_int_DesfireSetConfiguration_aes_PK = uFR_int_DesfireSetConfiguration_aes_PK@20 @2103 + uFR_int_DesfireSetConfiguration_aes_PK_M = uFR_int_DesfireSetConfiguration_aes_PK_M@24 @2104 + uFR_int_DesfireSetConfiguration_des = uFR_int_DesfireSetConfiguration_des@20 @2105 + uFR_int_DesfireSetConfiguration_desM = uFR_int_DesfireSetConfiguration_desM@24 @2106 + uFR_int_DesfireSetConfiguration_des_PK = uFR_int_DesfireSetConfiguration_des_PK@20 @2107 + uFR_int_DesfireSetConfiguration_des_PK_M = uFR_int_DesfireSetConfiguration_des_PK_M@24 @2108 + uFR_int_DesfireSetTransactionTimer_aes = uFR_int_DesfireSetTransactionTimer_aes@20 @2109 + uFR_int_DesfireSetTransactionTimer_aesM = uFR_int_DesfireSetTransactionTimer_aesM@24 @2110 + uFR_int_DesfireSetTransactionTimer_aes_PK = uFR_int_DesfireSetTransactionTimer_aes_PK@20 @2111 + uFR_int_DesfireSetTransactionTimer_aes_PK_M = uFR_int_DesfireSetTransactionTimer_aes_PK_M@24 @2112 + uFR_int_DesfireUidReadECCSignature = uFR_int_DesfireUidReadECCSignature@12 @2113 + uFR_int_DesfireUidReadECCSignatureM = uFR_int_DesfireUidReadECCSignatureM@16 @2114 + uFR_int_DesfireWriteAesKey = uFR_int_DesfireWriteAesKey@8 @2115 + uFR_int_DesfireWriteAesKeyM = uFR_int_DesfireWriteAesKeyM@12 @2116 + uFR_int_DesfireWriteBackupDataFile_2k3des = uFR_int_DesfireWriteBackupDataFile_2k3des@40 @2117 + uFR_int_DesfireWriteBackupDataFile_2k3desM = uFR_int_DesfireWriteBackupDataFile_2k3desM@44 @2118 + uFR_int_DesfireWriteBackupDataFile_2k3des_PK = uFR_int_DesfireWriteBackupDataFile_2k3des_PK@40 @2119 + uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M = uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M@44 @2120 + uFR_int_DesfireWriteBackupDataFile_3k3des = uFR_int_DesfireWriteBackupDataFile_3k3des@40 @2121 + uFR_int_DesfireWriteBackupDataFile_3k3desM = uFR_int_DesfireWriteBackupDataFile_3k3desM@44 @2122 + uFR_int_DesfireWriteBackupDataFile_3k3des_PK = uFR_int_DesfireWriteBackupDataFile_3k3des_PK@40 @2123 + uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M = uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M@44 @2124 + uFR_int_DesfireWriteBackupDataFile_aes = uFR_int_DesfireWriteBackupDataFile_aes@40 @2125 + uFR_int_DesfireWriteBackupDataFile_aesM = uFR_int_DesfireWriteBackupDataFile_aesM@44 @2126 + uFR_int_DesfireWriteBackupDataFile_aes_PK = uFR_int_DesfireWriteBackupDataFile_aes_PK@40 @2127 + uFR_int_DesfireWriteBackupDataFile_aes_PK_M = uFR_int_DesfireWriteBackupDataFile_aes_PK_M@44 @2128 + uFR_int_DesfireWriteBackupDataFile_des = uFR_int_DesfireWriteBackupDataFile_des@40 @2129 + uFR_int_DesfireWriteBackupDataFile_desM = uFR_int_DesfireWriteBackupDataFile_desM@44 @2130 + uFR_int_DesfireWriteBackupDataFile_des_PK = uFR_int_DesfireWriteBackupDataFile_des_PK@40 @2131 + uFR_int_DesfireWriteBackupDataFile_des_PK_M = uFR_int_DesfireWriteBackupDataFile_des_PK_M@44 @2132 + uFR_int_DesfireWriteBackupDataFile_no_auth = uFR_int_DesfireWriteBackupDataFile_no_auth@36 @2133 + uFR_int_DesfireWriteBackupDataFile_no_auth_M = uFR_int_DesfireWriteBackupDataFile_no_auth_M@40 @2134 + uFR_int_DesfireWriteKey = uFR_int_DesfireWriteKey@12 @2135 + uFR_int_DesfireWriteKeyM = uFR_int_DesfireWriteKeyM@16 @2136 + uFR_int_DesfireWriteNDEFMessage = uFR_int_DesfireWriteNDEFMessage@8 @2137 + uFR_int_DesfireWriteNDEFPayload = uFR_int_DesfireWriteNDEFPayload@4 @2138 + uFR_int_DesfireWriteRecord_2k3des = uFR_int_DesfireWriteRecord_2k3des@40 @2139 + uFR_int_DesfireWriteRecord_2k3desM = uFR_int_DesfireWriteRecord_2k3desM@44 @2140 + uFR_int_DesfireWriteRecord_2k3des_PK = uFR_int_DesfireWriteRecord_2k3des_PK@40 @2141 + uFR_int_DesfireWriteRecord_2k3des_PK_M = uFR_int_DesfireWriteRecord_2k3des_PK_M@44 @2142 + uFR_int_DesfireWriteRecord_3k3des = uFR_int_DesfireWriteRecord_3k3des@40 @2143 + uFR_int_DesfireWriteRecord_3k3desM = uFR_int_DesfireWriteRecord_3k3desM@44 @2144 + uFR_int_DesfireWriteRecord_3k3des_PK = uFR_int_DesfireWriteRecord_3k3des_PK@40 @2145 + uFR_int_DesfireWriteRecord_3k3des_PK_M = uFR_int_DesfireWriteRecord_3k3des_PK_M@44 @2146 + uFR_int_DesfireWriteRecord_TransMac_2k3des = uFR_int_DesfireWriteRecord_TransMac_2k3des@60 @2147 + uFR_int_DesfireWriteRecord_TransMac_2k3desM = uFR_int_DesfireWriteRecord_TransMac_2k3desM@64 @2148 + uFR_int_DesfireWriteRecord_TransMac_2k3des_PK = uFR_int_DesfireWriteRecord_TransMac_2k3des_PK@60 @2149 + uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M = uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M@64 @2150 + uFR_int_DesfireWriteRecord_TransMac_3k3des = uFR_int_DesfireWriteRecord_TransMac_3k3des@60 @2151 + uFR_int_DesfireWriteRecord_TransMac_3k3desM = uFR_int_DesfireWriteRecord_TransMac_3k3desM@64 @2152 + uFR_int_DesfireWriteRecord_TransMac_3k3des_PK = uFR_int_DesfireWriteRecord_TransMac_3k3des_PK@60 @2153 + uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M = uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M@64 @2154 + uFR_int_DesfireWriteRecord_TransMac_aes = uFR_int_DesfireWriteRecord_TransMac_aes@60 @2155 + uFR_int_DesfireWriteRecord_TransMac_aesM = uFR_int_DesfireWriteRecord_TransMac_aesM@64 @2156 + uFR_int_DesfireWriteRecord_TransMac_aes_PK = uFR_int_DesfireWriteRecord_TransMac_aes_PK@60 @2157 + uFR_int_DesfireWriteRecord_TransMac_aes_PK_M = uFR_int_DesfireWriteRecord_TransMac_aes_PK_M@64 @2158 + uFR_int_DesfireWriteRecord_TransMac_des = uFR_int_DesfireWriteRecord_TransMac_des@60 @2159 + uFR_int_DesfireWriteRecord_TransMac_desM = uFR_int_DesfireWriteRecord_TransMac_desM@64 @2160 + uFR_int_DesfireWriteRecord_TransMac_des_PK = uFR_int_DesfireWriteRecord_TransMac_des_PK@60 @2161 + uFR_int_DesfireWriteRecord_TransMac_des_PK_M = uFR_int_DesfireWriteRecord_TransMac_des_PK_M@64 @2162 + uFR_int_DesfireWriteRecord_TransMac_no_auth = uFR_int_DesfireWriteRecord_TransMac_no_auth@56 @2163 + uFR_int_DesfireWriteRecord_TransMac_no_auth_M = uFR_int_DesfireWriteRecord_TransMac_no_auth_M@60 @2164 + uFR_int_DesfireWriteRecord_aes = uFR_int_DesfireWriteRecord_aes@40 @2165 + uFR_int_DesfireWriteRecord_aesM = uFR_int_DesfireWriteRecord_aesM@44 @2166 + uFR_int_DesfireWriteRecord_aes_PK = uFR_int_DesfireWriteRecord_aes_PK@40 @2167 + uFR_int_DesfireWriteRecord_aes_PK_M = uFR_int_DesfireWriteRecord_aes_PK_M@44 @2168 + uFR_int_DesfireWriteRecord_des = uFR_int_DesfireWriteRecord_des@40 @2169 + uFR_int_DesfireWriteRecord_desM = uFR_int_DesfireWriteRecord_desM@44 @2170 + uFR_int_DesfireWriteRecord_des_PK = uFR_int_DesfireWriteRecord_des_PK@40 @2171 + uFR_int_DesfireWriteRecord_des_PK_M = uFR_int_DesfireWriteRecord_des_PK_M@44 @2172 + uFR_int_DesfireWriteRecord_no_auth = uFR_int_DesfireWriteRecord_no_auth@36 @2173 + uFR_int_DesfireWriteRecord_no_authM = uFR_int_DesfireWriteRecord_no_authM@40 @2174 + uFR_int_DesfireWriteStdDataFile = uFR_int_DesfireWriteStdDataFile@40 @2175 + uFR_int_DesfireWriteStdDataFileM = uFR_int_DesfireWriteStdDataFileM@44 @2176 + uFR_int_DesfireWriteStdDataFile_2k3des = uFR_int_DesfireWriteStdDataFile_2k3des@40 @2177 + uFR_int_DesfireWriteStdDataFile_2k3desM = uFR_int_DesfireWriteStdDataFile_2k3desM@44 @2178 + uFR_int_DesfireWriteStdDataFile_2k3des_PK = uFR_int_DesfireWriteStdDataFile_2k3des_PK@40 @2179 + uFR_int_DesfireWriteStdDataFile_2k3des_PK_M = uFR_int_DesfireWriteStdDataFile_2k3des_PK_M@44 @2180 + uFR_int_DesfireWriteStdDataFile_3k3des = uFR_int_DesfireWriteStdDataFile_3k3des@40 @2181 + uFR_int_DesfireWriteStdDataFile_3k3desM = uFR_int_DesfireWriteStdDataFile_3k3desM@44 @2182 + uFR_int_DesfireWriteStdDataFile_3k3des_PK = uFR_int_DesfireWriteStdDataFile_3k3des_PK@40 @2183 + uFR_int_DesfireWriteStdDataFile_3k3des_PK_M = uFR_int_DesfireWriteStdDataFile_3k3des_PK_M@44 @2184 + uFR_int_DesfireWriteStdDataFile_PK = uFR_int_DesfireWriteStdDataFile_PK@40 @2185 + uFR_int_DesfireWriteStdDataFile_PK_M = uFR_int_DesfireWriteStdDataFile_PK_M@44 @2186 + uFR_int_DesfireWriteStdDataFile_aes = uFR_int_DesfireWriteStdDataFile_aes@40 @2187 + uFR_int_DesfireWriteStdDataFile_aesM = uFR_int_DesfireWriteStdDataFile_aesM@44 @2188 + uFR_int_DesfireWriteStdDataFile_aes_PK = uFR_int_DesfireWriteStdDataFile_aes_PK@40 @2189 + uFR_int_DesfireWriteStdDataFile_aes_PK_M = uFR_int_DesfireWriteStdDataFile_aes_PK_M@44 @2190 + uFR_int_DesfireWriteStdDataFile_des = uFR_int_DesfireWriteStdDataFile_des@40 @2191 + uFR_int_DesfireWriteStdDataFile_desM = uFR_int_DesfireWriteStdDataFile_desM@44 @2192 + uFR_int_DesfireWriteStdDataFile_des_PK = uFR_int_DesfireWriteStdDataFile_des_PK@40 @2193 + uFR_int_DesfireWriteStdDataFile_des_PK_M = uFR_int_DesfireWriteStdDataFile_des_PK_M@44 @2194 + uFR_int_DesfireWriteStdDataFile_no_auth = uFR_int_DesfireWriteStdDataFile_no_auth@36 @2195 + uFR_int_DesfireWriteStdDataFile_no_auth_M = uFR_int_DesfireWriteStdDataFile_no_auth_M@40 @2196 + uFR_int_GetDesfireUid = uFR_int_GetDesfireUid@28 @2197 + uFR_int_GetDesfireUidM = uFR_int_GetDesfireUidM@32 @2198 + uFR_int_GetDesfireUid_2k3des = uFR_int_GetDesfireUid_2k3des@28 @2199 + uFR_int_GetDesfireUid_2k3desM = uFR_int_GetDesfireUid_2k3desM@32 @2200 + uFR_int_GetDesfireUid_2k3des_PK = uFR_int_GetDesfireUid_2k3des_PK@28 @2201 + uFR_int_GetDesfireUid_2k3des_PK_M = uFR_int_GetDesfireUid_2k3des_PK_M@32 @2202 + uFR_int_GetDesfireUid_3k3des = uFR_int_GetDesfireUid_3k3des@28 @2203 + uFR_int_GetDesfireUid_3k3desM = uFR_int_GetDesfireUid_3k3desM@32 @2204 + uFR_int_GetDesfireUid_3k3des_PK = uFR_int_GetDesfireUid_3k3des_PK@28 @2205 + uFR_int_GetDesfireUid_3k3des_PK_M = uFR_int_GetDesfireUid_3k3des_PK_M@32 @2206 + uFR_int_GetDesfireUid_PK = uFR_int_GetDesfireUid_PK@28 @2207 + uFR_int_GetDesfireUid_PK_M = uFR_int_GetDesfireUid_PK_M@32 @2208 + uFR_int_GetDesfireUid_aes = uFR_int_GetDesfireUid_aes@28 @2209 + uFR_int_GetDesfireUid_aesM = uFR_int_GetDesfireUid_aesM@32 @2210 + uFR_int_GetDesfireUid_aes_PK = uFR_int_GetDesfireUid_aes_PK@28 @2211 + uFR_int_GetDesfireUid_aes_PK_M = uFR_int_GetDesfireUid_aes_PK_M@32 @2212 + uFR_int_GetDesfireUid_des = uFR_int_GetDesfireUid_des@28 @2213 + uFR_int_GetDesfireUid_desM = uFR_int_GetDesfireUid_desM@32 @2214 + uFR_int_GetDesfireUid_des_PK = uFR_int_GetDesfireUid_des_PK@28 @2215 + uFR_int_GetDesfireUid_des_PK_M = uFR_int_GetDesfireUid_des_PK_M@32 @2216 + uFR_mifare_desfire_aes_key_new_with_version = uFR_mifare_desfire_aes_key_new_with_version@8 @2217 + uFR_mifare_desfire_des_key_new = uFR_mifare_desfire_des_key_new@4 @2218 + uFR_mifare_desfire_key_free = uFR_mifare_desfire_key_free@4 @2219 + uFR_mifare_desfire_tag_free = uFR_mifare_desfire_tag_free@4 @2220 + uFR_mifare_desfire_tag_new = uFR_mifare_desfire_tag_new@0 @2221 + uart_transceive = uart_transceive@20 @2222 + uart_transceiveM = uart_transceiveM@24 @2223 + write_ndef_record = write_ndef_record@36 @2224 + write_ndef_recordM = write_ndef_recordM@40 @2225 + write_ndef_record_mirroring = write_ndef_record_mirroring@48 @2226 + write_ndef_record_mirroringM = write_ndef_record_mirroringM@52 @2227 + write_ndef_record_mirroring_tt = write_ndef_record_mirroring_tt@52 @2228 + write_ndef_record_mirroring_ttM = write_ndef_record_mirroring_ttM@56 @2229 diff --git a/lib/windows/x86/uFCoder-x86.dll b/lib/windows/x86/uFCoder-x86.dll new file mode 100644 index 0000000000000000000000000000000000000000..4931f338854a7293f4ae2b8e5d9fa2eeb49103f9 Binary files /dev/null and b/lib/windows/x86/uFCoder-x86.dll differ diff --git a/lib/windows/x86_64/COMuFCoder-x86_64.dll b/lib/windows/x86_64/COMuFCoder-x86_64.dll new file mode 100644 index 0000000000000000000000000000000000000000..40bf35952ef0b32e12d7ab978476a63a2bdd3af0 Binary files /dev/null and b/lib/windows/x86_64/COMuFCoder-x86_64.dll differ diff --git a/lib/windows/x86_64/COMuFCoder-x86_64.tlb b/lib/windows/x86_64/COMuFCoder-x86_64.tlb new file mode 100644 index 0000000000000000000000000000000000000000..5b26410ecfe4591f85f927ec0e7c34b4bc8fe814 Binary files /dev/null and b/lib/windows/x86_64/COMuFCoder-x86_64.tlb differ diff --git a/lib/windows/x86_64/libeay32.dll b/lib/windows/x86_64/libeay32.dll new file mode 100644 index 0000000000000000000000000000000000000000..950b5c26731a2dc9fea6e40d6f0e0d920b22e664 Binary files /dev/null and b/lib/windows/x86_64/libeay32.dll differ diff --git a/lib/windows/x86_64/uFCoder-x86_64.def b/lib/windows/x86_64/uFCoder-x86_64.def new file mode 100644 index 0000000000000000000000000000000000000000..476a825195bebb07de2828becb91a264b07811fd --- /dev/null +++ b/lib/windows/x86_64/uFCoder-x86_64.def @@ -0,0 +1,2230 @@ +EXPORTS + AES_to_DES_key_type @1 + APDUHexStrTransceive @2 + APDUHexStrTransceiveM @3 + APDUPlainTransceive @4 + APDUPlainTransceiveM @5 + APDUPlainTransceiveToHeap @6 + APDUPlainTransceiveToHeapM @7 + APDUTransceive @8 + APDUTransceiveM @9 + APDU_switch_off_from_ISO7816_interface @10 + APDU_switch_off_from_ISO7816_interfaceM @11 + APDU_switch_to_ISO14443_4_interface @12 + APDU_switch_to_ISO14443_4_interfaceM @13 + APDU_switch_to_ISO7816_interface @14 + APDU_switch_to_ISO7816_interfaceM @15 + ATECC608LockConfig @16 + ATECC608LockConfigM @17 + ATECC608LockDataAndOtp @18 + ATECC608LockDataAndOtpM @19 + ATECC608LockKeySlot @20 + ATECC608LockKeySlotM @21 + AdHocEmulationStart @22 + AdHocEmulationStartM @23 + AdHocEmulationStop @24 + AdHocEmulationStopM @25 + AutoSleepGet @26 + AutoSleepGetM @27 + AutoSleepSet @28 + AutoSleepSetM @29 + BalanceGet @30 + BalanceGetM @31 + BalanceSet @32 + BalanceSetM @33 + BlockInSectorRead @34 + BlockInSectorReadM @35 + BlockInSectorReadSamKey @36 + BlockInSectorReadSamkeyM @37 + BlockInSectorRead_AKM1 @38 + BlockInSectorRead_AKM1M @39 + BlockInSectorRead_AKM2 @40 + BlockInSectorRead_AKM2M @41 + BlockInSectorRead_PK @42 + BlockInSectorRead_PKM @43 + BlockInSectorWrite @44 + BlockInSectorWriteM @45 + BlockInSectorWriteSamKey @46 + BlockInSectorWriteSamkeyM @47 + BlockInSectorWrite_AKM1 @48 + BlockInSectorWrite_AKM1M @49 + BlockInSectorWrite_AKM2 @50 + BlockInSectorWrite_AKM2M @51 + BlockInSectorWrite_PK @52 + BlockInSectorWrite_PKM @53 + BlockRead @54 + BlockReadM @55 + BlockReadSamKey @56 + BlockReadSamKeyM @57 + BlockRead_AKM1 @58 + BlockRead_AKM1M @59 + BlockRead_AKM2 @60 + BlockRead_AKM2M @61 + BlockRead_PK @62 + BlockRead_PKM @63 + BlockWrite @64 + BlockWriteM @65 + BlockWriteSamKey @66 + BlockWriteSamKeyM @67 + BlockWrite_AKM1 @68 + BlockWrite_AKM1M @69 + BlockWrite_AKM2 @70 + BlockWrite_AKM2M @71 + BlockWrite_PK @72 + BlockWrite_PKM @73 + BootReader @74 + BusAdminCardMake @75 + COMTransceive @76 + COMTransceiveM @77 + CardEncryption_GetActualCardSN @78 + CardEncryption_GetActualCardSNM @79 + CardEncryption_GetJobSN @80 + CardEncryption_GetJobSNM @81 + CardEncryption_GetNext @82 + CardEncryption_GetNextEncryptedCard @83 + CardEncryption_GetNextEncryptedCardM @84 + CardEncryption_GetNextM @85 + CardEncryption_GetSalterSN @86 + CardEncryption_GetSalterSNM @87 + CardEncryption_Initialize @88 + CardEncryption_InitializeM @89 + ChangeReaderJobId @90 + ChangeReaderJobIdM @91 + ChangeReaderPassword @92 + ChangeReaderPasswordM @93 + CheckUidChangeable @94 + CheckUidChangeableM @95 + CombinedModeEmulationStart @96 + CombinedModeEmulationStartM @97 + DES_to_AES_key_type @98 + DLFree @99 + DLGetEccCurveName @100 + DLGetHash @101 + DLGetHashName @102 + DLGetHashOutputByteLength @103 + DLGetHashToHeap @104 + DLGetSignatureSchemeName @105 + DLHashFinishChunked @106 + DLHashFinishChunkedToHeap @107 + DLHashInitChunked @108 + DLHashUpdateChunked @109 + DL_TLS_Request @110 + DL_TLS_SetClientCertificate @111 + DL_TLS_SetClientX509PrivateKey_PEM @112 + DefaultBaudrateFlashCheck @113 + DefaultBaudrateFlashCheckM @114 + DeslectCard @115 + DeslectCardM @116 + DigitalSignatureVerifyHash @117 + DisableAntiCollision @118 + DisableAntiCollisionM @119 + Display_EraseSection @120 + Display_PrintText @121 + Display_SaveBitmapToGallery @122 + Display_SaveSystemBitmap @123 + Display_ShowBitmap @124 + Display_ShowBitmapFromGallery @125 + Display_ShowLastUnsavedImage @126 + Display_ShowTime @127 + Display_Transmit @128 + Display_UserInterfaceSignal @129 + EE_Lock @130 + EE_Password_Change @131 + EE_Read @132 + EE_Write @133 + EMV_GetLastTransaction @134 + EMV_GetPAN @135 + EnableAntiCollision @136 + EnableAntiCollisionM @137 + EnterShareRamCommMode @138 + EnterShareRamCommModeM @139 + EnumCards @140 + EnumCardsM @141 + EspChangeReaderPassword @142 + EspChangeReaderPasswordM @143 + EspDisableWifi @144 + EspDisableWifiM @145 + EspEnableWifi @146 + EspEnableWifiM @147 + EspGetFirmwareVersion @148 + EspGetFirmwareVersionM @149 + EspGetIOState @150 + EspGetIOStateM @151 + EspGetReaderSerialNumber @152 + EspGetReaderSerialNumberM @153 + EspGetReaderTime @154 + EspGetReaderTimeM @155 + EspGetTransparentReaders @156 + EspReaderEepromRead @157 + EspReaderEepromReadM @158 + EspReaderEepromWrite @159 + EspReaderEepromWriteM @160 + EspReaderReset @161 + EspReaderResetM @162 + EspSetDisplayData @163 + EspSetDisplayDataM @164 + EspSetIOState @165 + EspSetIOStateM @166 + EspSetReaderTime @167 + EspSetReaderTimeM @168 + EspSetTransparentReader @169 + EspSetTransparentReaderM @170 + EspSetTransparentReaderSession @171 + EspTurnOff @172 + EspTurnOffM @173 + ExitShareRamCommMode @174 + ExitShareRamCommModeM @175 + FastFlashCheck @176 + FastFlashCheckM @177 + GetATECC608ConfigZone @178 + GetATECC608ConfigZoneM @179 + GetATECC608InfoRevision @180 + GetATECC608InfoRevisionM @181 + GetATECC608OtpZone @182 + GetATECC608OtpZoneM @183 + GetATECC608ZonesLockStatus @184 + GetATECC608ZonesLockStatusM @185 + GetAdHocEmulationParams @186 + GetAdHocEmulationParamsM @187 + GetAntiCollisionStatus @188 + GetAntiCollisionStatusM @189 + GetAsyncCardIdSendConfig @190 + GetAsyncCardIdSendConfigEx @191 + GetAsyncCardIdSendConfigExM @192 + GetAsyncCardIdSendConfigM @193 + GetAtqaSak @194 + GetAtqaSakM @195 + GetBuildNumber @196 + GetBuildNumberM @197 + GetCardId @198 + GetCardIdEx @199 + GetCardIdExM @200 + GetCardIdM @201 + GetCardManufacturer @202 + GetCardManufacturerM @203 + GetCardSize @204 + GetCardSizeM @205 + GetCustomUiConfig @206 + GetCustomUiConfigM @207 + GetDiscoveryLoopSetup @208 + GetDiscoveryLoopSetupM @209 + GetDisplayIntensity @210 + GetDisplayIntensityM @211 + GetDllVersion @212 + GetDllVersionStr @213 + GetDlogicCardType @214 + GetDlogicCardTypeM @215 + GetExternalFieldState @216 + GetExternalFieldStateM @217 + GetFtdiDriverVersion @218 + GetFtdiDriverVersionM @219 + GetFtdiDriverVersionStr @220 + GetFtdiDriverVersionStrM @221 + GetLastCardIdEx @222 + GetLastCardIdExM @223 + GetLicenseRequestData @224 + GetMobileAdditionalData @225 + GetMobileAdditionalDataM @226 + GetMobileUniqueIdAid @227 + GetMobileUniqueIdAidM @228 + GetNfcT2TVersion @229 + GetNfcT2TVersionM @230 + GetReaderDescription @231 + GetReaderDescriptionM @232 + GetReaderFirmwareVersion @233 + GetReaderFirmwareVersionM @234 + GetReaderHardwareVersion @235 + GetReaderHardwareVersionM @236 + GetReaderParameters @237 + GetReaderParametersDefaultBaudrate @238 + GetReaderParametersDefaultBaudrateM @239 + GetReaderParametersM @240 + GetReaderParametersPN7462 @241 + GetReaderParametersPN7462_M @242 + GetReaderProMode @243 + GetReaderProModeM @244 + GetReaderSerialDescription @245 + GetReaderSerialDescriptionM @246 + GetReaderSerialNumber @247 + GetReaderSerialNumberM @248 + GetReaderStatus @249 + GetReaderStatusEx @250 + GetReaderStatusExM @251 + GetReaderStatusM @252 + GetReaderTime @253 + GetReaderTimeM @254 + GetReaderType @255 + GetReaderTypeM @256 + GetRfAnalogRegistersISO14443_212 @257 + GetRfAnalogRegistersISO14443_212M @258 + GetRfAnalogRegistersISO14443_424 @259 + GetRfAnalogRegistersISO14443_424M @260 + GetRfAnalogRegistersTypeA @261 + GetRfAnalogRegistersTypeAM @262 + GetRfAnalogRegistersTypeATrans @263 + GetRfAnalogRegistersTypeATransM @264 + GetRfAnalogRegistersTypeB @265 + GetRfAnalogRegistersTypeBM @266 + GetRfAnalogRegistersTypeBTrans @267 + GetRfAnalogRegistersTypeBTransM @268 + GetRgbIntensity @269 + GetRgbIntensityM @270 + GetServiceData @271 + GetServiceDataM @272 + GetSpeedParameters @273 + GetSpeedParametersM @274 + GreenLedBlinkingTurnOff @275 + GreenLedBlinkingTurnOffM @276 + GreenLedBlinkingTurnOn @277 + GreenLedBlinkingTurnOnM @278 + IncrementCounter @279 + IncrementCounterM @280 + JCAppDeleteEcKeyPair @281 + JCAppDeleteEcKeyPairM @282 + JCAppDeleteRsaKeyPair @283 + JCAppDeleteRsaKeyPairM @284 + JCAppGenerateKeyPair @285 + JCAppGenerateKeyPairM @286 + JCAppGenerateSignature @287 + JCAppGenerateSignatureM @288 + JCAppGetEcKeySizeBits @289 + JCAppGetEcKeySizeBitsM @290 + JCAppGetEcPublicKey @291 + JCAppGetEcPublicKeyM @292 + JCAppGetErrorDescription @293 + JCAppGetObj @294 + JCAppGetObjId @295 + JCAppGetObjIdM @296 + JCAppGetObjM @297 + JCAppGetObjSubject @298 + JCAppGetObjSubjectM @299 + JCAppGetPinTriesRemaining @300 + JCAppGetPinTriesRemainingM @301 + JCAppGetRsaPublicKey @302 + JCAppGetRsaPublicKeyM @303 + JCAppGetSignature @304 + JCAppInvalidateCert @305 + JCAppInvalidateCertM @306 + JCAppLogin @307 + JCAppLoginM @308 + JCAppPinChange @309 + JCAppPinChangeM @310 + JCAppPinDisable @311 + JCAppPinDisableM @312 + JCAppPinEnable @313 + JCAppPinEnableM @314 + JCAppPinUnblock @315 + JCAppPinUnblockM @316 + JCAppPutObj @317 + JCAppPutObjM @318 + JCAppPutObjSubject @319 + JCAppPutObjSubjectM @320 + JCAppPutPrivateKey @321 + JCAppPutPrivateKeyM @322 + JCAppSelectByAid @323 + JCAppSelectByAidM @324 + JCAppSignatureBegin @325 + JCAppSignatureBeginM @326 + JCAppSignatureEnd @327 + JCAppSignatureEndM @328 + JCAppSignatureUpdate @329 + JCAppSignatureUpdateM @330 + JCStorageDeleteFile @331 + JCStorageDeleteFileM @332 + JCStorageGetFileSize @333 + JCStorageGetFileSizeM @334 + JCStorageGetFilesListSize @335 + JCStorageGetFilesListSizeM @336 + JCStorageListFiles @337 + JCStorageListFilesM @338 + JCStorageReadFile @339 + JCStorageReadFileM @340 + JCStorageReadFileToFileSystem @341 + JCStorageReadFileToFileSystemM @342 + JCStorageWriteFile @343 + JCStorageWriteFileFromFileSystem @344 + JCStorageWriteFileFromFileSystemM @345 + JCStorageWriteFileM @346 + LinRowRead @347 + LinRowReadM @348 + LinRowRead_AKM1 @349 + LinRowRead_AKM1M @350 + LinRowRead_AKM2 @351 + LinRowRead_AKM2M @352 + LinRowRead_PK @353 + LinRowRead_PKM @354 + LinearFormatCard @355 + LinearFormatCardM @356 + LinearFormatCard_AKM1 @357 + LinearFormatCard_AKM1M @358 + LinearFormatCard_AKM2 @359 + LinearFormatCard_AKM2M @360 + LinearFormatCard_PK @361 + LinearFormatCard_PKM @362 + LinearRead @363 + LinearReadM @364 + LinearReadSamKey @365 + LinearReadSamKeyM @366 + LinearRead_AKM1 @367 + LinearRead_AKM1M @368 + LinearRead_AKM2 @369 + LinearRead_AKM2M @370 + LinearRead_PK @371 + LinearRead_PKM @372 + LinearWrite @373 + LinearWriteM @374 + LinearWriteSamKey @375 + LinearWriteSamKeyM @376 + LinearWrite_AKM1 @377 + LinearWrite_AKM1M @378 + LinearWrite_AKM2 @379 + LinearWrite_AKM2M @380 + LinearWrite_PK @381 + LinearWrite_PKM @382 + ListCards @383 + ListCardsM @384 + MFP_AesAuthSecurityLevel1 @385 + MFP_AesAuthSecurityLevel1M @386 + MFP_AesAuthSecurityLevel1_PK @387 + MFP_AesAuthSecurityLevel1_PKM @388 + MFP_ChangeConfigurationKey @389 + MFP_ChangeConfigurationKeyM @390 + MFP_ChangeConfigurationKeySamKey @391 + MFP_ChangeConfigurationKeySamKeyM @392 + MFP_ChangeConfigurationKey_PK @393 + MFP_ChangeConfigurationKey_PKM @394 + MFP_ChangeMasterKey @395 + MFP_ChangeMasterKeyM @396 + MFP_ChangeMasterKeySamKey @397 + MFP_ChangeMasterKeySamKeyM @398 + MFP_ChangeMasterKey_PK @399 + MFP_ChangeMasterKey_PKM @400 + MFP_ChangeSectorExtKey @401 + MFP_ChangeSectorExtKeyM @402 + MFP_ChangeSectorKey @403 + MFP_ChangeSectorKeyExt_PK @404 + MFP_ChangeSectorKeyExt_PKM @405 + MFP_ChangeSectorKeyM @406 + MFP_ChangeSectorKeySamExtKey @407 + MFP_ChangeSectorKeySamExtKeyM @408 + MFP_ChangeSectorKeySamKey @409 + MFP_ChangeSectorKeySamKeyM @410 + MFP_ChangeSectorKey_PK @411 + MFP_ChangeSectorKey_PKM @412 + MFP_ChangeVcPollingEncKey @413 + MFP_ChangeVcPollingEncKeyM @414 + MFP_ChangeVcPollingEncKeySamKey @415 + MFP_ChangeVcPollingEncKeySamKeyM @416 + MFP_ChangeVcPollingEncKey_PK @417 + MFP_ChangeVcPollingEncKey_PKM @418 + MFP_ChangeVcPollingMacKey @419 + MFP_ChangeVcPollingMacKeyM @420 + MFP_ChangeVcPollingMacKeySamKey @421 + MFP_ChangeVcPollingMacKeySamKeyM @422 + MFP_ChangeVcPollingMacKey_PK @423 + MFP_ChangeVcPollingMacKey_PKM @424 + MFP_CommitPerso @425 + MFP_CommitPersoM @426 + MFP_FieldConfigurationSet @427 + MFP_FieldConfigurationSetM @428 + MFP_FieldConfigurationSetSamKey @429 + MFP_FieldConfigurationSetSamKeyM @430 + MFP_FieldConfigurationSet_PK @431 + MFP_FieldConfigurationSet_PKM @432 + MFP_GetUid @433 + MFP_GetUidM @434 + MFP_GetUidSamKey @435 + MFP_GetUidSamKeyM @436 + MFP_GetUid_PK @437 + MFP_GetUid_PKM @438 + MFP_PersonalizationMinimal @439 + MFP_PersonalizationMinimalM @440 + MFP_SwitchToSecurityLevel3 @441 + MFP_SwitchToSecurityLevel3M @442 + MFP_SwitchToSecurityLevel3_PK @443 + MFP_SwitchToSecurityLevel3_PKM @444 + MFP_WritePerso @445 + MFP_WritePersoM @446 + MRTDAppSelectAndAuthenticateBac @447 + MRTDAppSelectAndAuthenticateBacM @448 + MRTDFileReadBacToHeap @449 + MRTDFileReadBacToHeapM @450 + MRTDGetDGTagListFromCOM @451 + MRTDGetDgIndex @452 + MRTDGetDgName @453 + MRTDGetImageFromDG2 @454 + MRTDGetImageFromDG2ToFile @455 + MRTDParseDG1ToHeap @456 + MRTDValidate @457 + MRTDValidateM @458 + MRTD_MRZDataToMRZProtoKey @459 + MRTD_MRZSubjacentCheck @460 + MRTD_MRZSubjacentToMRZProtoKey @461 + NfcT2TSafeConvertVersion @462 + Open_ISO7816_Generic @463 + Open_ISO7816_GenericM @464 + OriginalityCheck @465 + PN7462_CodeProtect @466 + PN7462_ESP32_boot_init @467 + PN7462_ExtField @468 + PN7462_LpcdCalibration @469 + PN7462_LpcdPerform @470 + PN7462_RfOff @471 + PN7462_RfOn @472 + PN7462_Test @473 + PN7462_WriteParams @474 + PN7462_WriteParamsUsb @475 + ParamTest1 @476 + ParamTest2 @477 + ParseNdefMessage @478 + ProgReader @479 + ProgReaderStreamUsb @480 + ProgReaderUsb @481 + ReadCounter @482 + ReadCounterM @483 + ReadECCSignature @484 + ReadECCSignatureExt @485 + ReadECCSignatureExtM @486 + ReadECCSignatureM @487 + ReadNFCCounter @488 + ReadNFCCounterM @489 + ReadNFCCounterPwdAuth_PK @490 + ReadNFCCounterPwdAuth_PKM @491 + ReadNFCCounterPwdAuth_RK @492 + ReadNFCCounterPwdAuth_RKM @493 + ReadNdefRecord_Address @494 + ReadNdefRecord_AddressM @495 + ReadNdefRecord_AndroidApp @496 + ReadNdefRecord_AndroidAppM @497 + ReadNdefRecord_BT @498 + ReadNdefRecord_BTM @499 + ReadNdefRecord_Bitcoin @500 + ReadNdefRecord_BitcoinM @501 + ReadNdefRecord_Contact @502 + ReadNdefRecord_ContactM @503 + ReadNdefRecord_Email @504 + ReadNdefRecord_EmailM @505 + ReadNdefRecord_GeoLocation @506 + ReadNdefRecord_GeoLocationM @507 + ReadNdefRecord_NaviDestination @508 + ReadNdefRecord_NaviDestinationM @509 + ReadNdefRecord_Phone @510 + ReadNdefRecord_PhoneM @511 + ReadNdefRecord_SMS @512 + ReadNdefRecord_SMSM @513 + ReadNdefRecord_Skype @514 + ReadNdefRecord_SkypeM @515 + ReadNdefRecord_StreetView @516 + ReadNdefRecord_StreetViewM @517 + ReadNdefRecord_Text @518 + ReadNdefRecord_TextM @519 + ReadNdefRecord_Viber @520 + ReadNdefRecord_ViberM @521 + ReadNdefRecord_Whatsapp @522 + ReadNdefRecord_WhatsappM @523 + ReadNdefRecord_WiFi @524 + ReadNdefRecord_WiFiM @525 + ReadShareRam @526 + ReadShareRamM @527 + ReadTTStatus @528 + ReadTTStatusM @529 + ReadUserData @530 + ReadUserDataExt @531 + ReadUserDataExtM @532 + ReadUserDataM @533 + ReaderClose @534 + ReaderCloseM @535 + ReaderEepromRead @536 + ReaderEepromReadM @537 + ReaderEepromWrite @538 + ReaderEepromWriteM @539 + ReaderHwReset @540 + ReaderKeyWrite @541 + ReaderKeyWriteM @542 + ReaderKeysLock @543 + ReaderKeysLockM @544 + ReaderKeysUnlock @545 + ReaderKeysUnlockM @546 + ReaderList_Add @547 + ReaderList_Destroy @548 + ReaderList_GetFTDIDescriptionByIndex @549 + ReaderList_GetFTDISerialByIndex @550 + ReaderList_GetInformation @551 + ReaderList_GetSerialByIndex @552 + ReaderList_GetSerialDescriptionByIndex @553 + ReaderList_GetTypeByIndex @554 + ReaderList_OpenByIndex @555 + ReaderList_OpenBySerial @556 + ReaderList_UpdateAndGetCount @557 + ReaderOpen @558 + ReaderOpenByType @559 + ReaderOpenEx @560 + ReaderOpenM @561 + ReaderOpen_uFROnline @562 + ReaderReset @563 + ReaderResetM @564 + ReaderResetWait @565 + ReaderRfOff @566 + ReaderRfOffM @567 + ReaderRfOn @568 + ReaderRfOnM @569 + ReaderRfReset @570 + ReaderRfResetM @571 + ReaderSoftRestart @572 + ReaderSoftRestartM @573 + ReaderSoundVolume @574 + ReaderSoundVolumeM @575 + ReaderStillConnected @576 + ReaderStillConnectedM @577 + ReaderUISignal @578 + ReaderUISignalM @579 + RgbControl @580 + RgbControlM @581 + RgbIdleDefault @582 + RgbIdleDefaultM @583 + RgbIdleSet @584 + RgbIdleSetM @585 + RgbInternalTurnOff @586 + RgbInternalTurnOffM @587 + RgbInternalTurnOn @588 + RgbInternalTurnOnM @589 + SAM_authenticate_host_AV2_plain @590 + SAM_authenticate_host_AV2_plainM @591 + SAM_authenticate_host_no_div_des @592 + SAM_authenticate_host_no_div_desM @593 + SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_key @594 + SAM_change_key_entry_2K3DES_ULC_AV2_plain_one_keyM @595 + SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_key @596 + SAM_change_key_entry_2K3DES_desfire_AV2_plain_one_keyM @597 + SAM_change_key_entry_3K3DES_AV2_plain_one_key @598 + SAM_change_key_entry_3K3DES_AV2_plain_one_keyM @599 + SAM_change_key_entry_AES_AV2_plain_one_key @600 + SAM_change_key_entry_AES_AV2_plain_one_keyM @601 + SAM_change_key_entry_DES_AV2_plain_one_key @602 + SAM_change_key_entry_aes_AV2_plain_host_key @603 + SAM_change_key_entry_aes_AV2_plain_host_keyM @604 + SAM_change_key_entry_mifare_AV2_plain_one_key @605 + SAM_change_key_entry_mifare_AV2_plain_one_keyM @606 + SAM_get_key_entry_raw @607 + SAM_get_key_entry_rawM @608 + SAM_get_version @609 + SAM_get_versionM @610 + SAM_get_version_raw @611 + SAM_get_version_rawM @612 + SAM_pre_personalization_switch_to_AV2_mode @613 + SAM_pre_personalization_switch_to_AV2_modeM @614 + SAM_pre_pesonalization_master_AES128_key @615 + SAM_pre_pesonalization_master_AES128_keyM @616 + SectorTrailerWrite @617 + SectorTrailerWriteM @618 + SectorTrailerWriteSamKey @619 + SectorTrailerWriteSamKeyM @620 + SectorTrailerWriteUnsafe @621 + SectorTrailerWriteUnsafeM @622 + SectorTrailerWriteUnsafe_AKM1 @623 + SectorTrailerWriteUnsafe_AKM1M @624 + SectorTrailerWriteUnsafe_AKM2 @625 + SectorTrailerWriteUnsafe_AKM2M @626 + SectorTrailerWriteUnsafe_PK @627 + SectorTrailerWriteUnsafe_PKM @628 + SectorTrailerWrite_AKM1 @629 + SectorTrailerWrite_AKM1M @630 + SectorTrailerWrite_AKM2 @631 + SectorTrailerWrite_AKM2M @632 + SectorTrailerWrite_PK @633 + SectorTrailerWrite_PKM @634 + SelectCard @635 + SelectCardM @636 + SetATECC608DefaultKeysConfiguration @637 + SetATECC608DefaultKeysConfigurationM @638 + SetATECC608DefaultSlotsConfiguration @639 + SetATECC608DefaultSlotsConfigurationM @640 + SetATECC608ECCPrivateKey @641 + SetATECC608ECCPrivateKeyM @642 + SetATECC608ECCPrivateKeyUnencrypted @643 + SetATECC608ECCPrivateKeyUnencryptedM @644 + SetATECC608IOSecretKey @645 + SetATECC608IOSecretKeyM @646 + SetAdHocEmulationParams @647 + SetAdHocEmulationParamsM @648 + SetAsyncCardIdSendConfig @649 + SetAsyncCardIdSendConfigEx @650 + SetAsyncCardIdSendConfigExM @651 + SetAsyncCardIdSendConfigM @652 + SetCustomUiConfig @653 + SetCustomUiConfigM @654 + SetDefaultUartSpeed @655 + SetDiscoveryLoop @656 + SetDiscoveryLoopM @657 + SetDisplayData @658 + SetDisplayDataM @659 + SetDisplayIntensity @660 + SetDisplayIntensityM @661 + SetISO14443_4_DLStorage @662 + SetISO14443_4_DLStorageM @663 + SetISO14443_4_Mode @664 + SetISO14443_4_ModeM @665 + SetISO14443_4_Mode_GetATS @666 + SetISO14443_4_Mode_GetATSM @667 + SetLicenseData @668 + SetMobileUniqueIdAid @669 + SetMobileUniqueIdAidM @670 + SetReaderProMode @671 + SetReaderProModeM @672 + SetReaderSerialDescription @673 + SetReaderSerialDescriptionM @674 + SetReaderTime @675 + SetReaderTimeM @676 + SetRfAnalogRegistersISO14443_212 @677 + SetRfAnalogRegistersISO14443_212Default @678 + SetRfAnalogRegistersISO14443_212DefaultM @679 + SetRfAnalogRegistersISO14443_212M @680 + SetRfAnalogRegistersISO14443_424 @681 + SetRfAnalogRegistersISO14443_424Default @682 + SetRfAnalogRegistersISO14443_424DefaultM @683 + SetRfAnalogRegistersISO14443_424M @684 + SetRfAnalogRegistersTypeA @685 + SetRfAnalogRegistersTypeADefault @686 + SetRfAnalogRegistersTypeADefaultM @687 + SetRfAnalogRegistersTypeAM @688 + SetRfAnalogRegistersTypeATrans @689 + SetRfAnalogRegistersTypeATransM @690 + SetRfAnalogRegistersTypeB @691 + SetRfAnalogRegistersTypeBDefault @692 + SetRfAnalogRegistersTypeBDefaultM @693 + SetRfAnalogRegistersTypeBM @694 + SetRfAnalogRegistersTypeBTrans @695 + SetRfAnalogRegistersTypeBTransM @696 + SetRgbData @697 + SetRgbDataM @698 + SetRgbIntensity @699 + SetRgbIntensityM @700 + SetServiceData @701 + SetServiceDataM @702 + SetSpeakerFrequency @703 + SetSpeakerFrequencyM @704 + SetSpeedPermanently @705 + SetSpeedPermanentlyM @706 + SetUartSpeed @707 + StartAsyncSession @708 + StopAsyncSession @709 + SubscribeBlock @710 + SubscribeSector @711 + TagEmulationMirrorCounterDisabled @712 + TagEmulationMirrorCounterNonResetEnabled @713 + TagEmulationMirrorCounterResetEnabled @714 + TagEmulationStart @715 + TagEmulationStartM @716 + TagEmulationStartRam @717 + TagEmulationStop @718 + TagEmulationStopM @719 + TagEmulationStopRam @720 + UFR_DLCardType2String @721 + UFR_SessionStatus2String @722 + UFR_Status2String @723 + ULC_ExternalAuth_PK @724 + ULC_ExternalAuth_PKM @725 + ULC_write_3des_key @726 + ULC_write_3des_keyM @727 + ULC_write_3des_key_factory_key @728 + ULC_write_3des_key_factory_keyM @729 + ULC_write_3des_key_factory_key_internal @730 + ULC_write_3des_key_factory_key_internalM @731 + ULC_write_3des_key_internal @732 + ULC_write_3des_key_internalM @733 + ULC_write_3des_key_no_auth @734 + ULC_write_3des_key_no_authM @735 + ULC_write_3des_key_no_auth_internal @736 + ULC_write_3des_key_no_auth_internalM @737 + UfrEnterSleepMode @738 + UfrEnterSleepModeM @739 + UfrGetBadSelectCardNrMax @740 + UfrGetBadSelectCardNrMaxM @741 + UfrGetInputState @742 + UfrLeaveSleepMode @743 + UfrLeaveSleepModeM @744 + UfrOutControl @745 + UfrOutControlM @746 + UfrRedLightControl @747 + UfrRedLightControlM @748 + UfrRgbExtLightControl @749 + UfrRgbExtLightControlM @750 + UfrRgbLightControl @751 + UfrRgbLightControlM @752 + UfrRgbLightControlRfPeriod @753 + UfrRgbLightControlRfPeriodM @754 + UfrRgbLightControlSleep @755 + UfrRgbLightControlSleepM @756 + UfrSetBadSelectCardNrMax @757 + UfrSetBadSelectCardNrMaxM @758 + UfrXrcGetIoState @759 + UfrXrcGetIoStateM @760 + UfrXrcLockOn @761 + UfrXrcLockOnM @762 + UfrXrcRelayState @763 + UfrXrcRelayStateM @764 + ValueBlockDecrement @765 + ValueBlockDecrementM @766 + ValueBlockDecrementSamKey @767 + ValueBlockDecrementSamKeyM @768 + ValueBlockDecrement_AKM1 @769 + ValueBlockDecrement_AKM1M @770 + ValueBlockDecrement_AKM2 @771 + ValueBlockDecrement_AKM2M @772 + ValueBlockDecrement_PK @773 + ValueBlockDecrement_PKM @774 + ValueBlockInSectorDecrement @775 + ValueBlockInSectorDecrementM @776 + ValueBlockInSectorDecrementSamKey @777 + ValueBlockInSectorDecrementSamKeyM @778 + ValueBlockInSectorDecrement_AKM1 @779 + ValueBlockInSectorDecrement_AKM1M @780 + ValueBlockInSectorDecrement_AKM2 @781 + ValueBlockInSectorDecrement_AKM2M @782 + ValueBlockInSectorDecrement_PK @783 + ValueBlockInSectorDecrement_PKM @784 + ValueBlockInSectorIncrement @785 + ValueBlockInSectorIncrementM @786 + ValueBlockInSectorIncrementSamKey @787 + ValueBlockInSectorIncrementSamKeyM @788 + ValueBlockInSectorIncrement_AKM1 @789 + ValueBlockInSectorIncrement_AKM1M @790 + ValueBlockInSectorIncrement_AKM2 @791 + ValueBlockInSectorIncrement_AKM2M @792 + ValueBlockInSectorIncrement_PK @793 + ValueBlockInSectorIncrement_PKM @794 + ValueBlockInSectorRead @795 + ValueBlockInSectorReadM @796 + ValueBlockInSectorReadSamKey @797 + ValueBlockInSectorReadSamKeyM @798 + ValueBlockInSectorRead_AKM1 @799 + ValueBlockInSectorRead_AKM1M @800 + ValueBlockInSectorRead_AKM2 @801 + ValueBlockInSectorRead_AKM2M @802 + ValueBlockInSectorRead_PK @803 + ValueBlockInSectorRead_PKM @804 + ValueBlockInSectorWrite @805 + ValueBlockInSectorWriteM @806 + ValueBlockInSectorWriteSamKey @807 + ValueBlockInSectorWriteSamKeyM @808 + ValueBlockInSectorWrite_AKM1 @809 + ValueBlockInSectorWrite_AKM1M @810 + ValueBlockInSectorWrite_AKM2 @811 + ValueBlockInSectorWrite_AKM2M @812 + ValueBlockInSectorWrite_PK @813 + ValueBlockInSectorWrite_PKM @814 + ValueBlockIncrement @815 + ValueBlockIncrementM @816 + ValueBlockIncrementSamKey @817 + ValueBlockIncrementSamKeyM @818 + ValueBlockIncrement_AKM1 @819 + ValueBlockIncrement_AKM1M @820 + ValueBlockIncrement_AKM2 @821 + ValueBlockIncrement_AKM2M @822 + ValueBlockIncrement_PK @823 + ValueBlockIncrement_PKM @824 + ValueBlockRead @825 + ValueBlockReadM @826 + ValueBlockReadSamKey @827 + ValueBlockReadSamKeyM @828 + ValueBlockRead_AKM1 @829 + ValueBlockRead_AKM1M @830 + ValueBlockRead_AKM2 @831 + ValueBlockRead_AKM2M @832 + ValueBlockRead_PK @833 + ValueBlockRead_PKM @834 + ValueBlockWrite @835 + ValueBlockWriteM @836 + ValueBlockWriteSamKey @837 + ValueBlockWriteSamKeyM @838 + ValueBlockWrite_AKM1 @839 + ValueBlockWrite_AKM1M @840 + ValueBlockWrite_AKM2 @841 + ValueBlockWrite_AKM2M @842 + ValueBlockWrite_PK @843 + ValueBlockWrite_PKM @844 + WriteEmulationNdef @845 + WriteEmulationNdefM @846 + WriteEmulationNdefRam @847 + WriteEmulationNdefRamM @848 + WriteEmulationNdefWithAAR @849 + WriteNdefRecord_Address @850 + WriteNdefRecord_AddressM @851 + WriteNdefRecord_AndroidApp @852 + WriteNdefRecord_AndroidAppM @853 + WriteNdefRecord_BT @854 + WriteNdefRecord_BTM @855 + WriteNdefRecord_Bitcoin @856 + WriteNdefRecord_BitcoinM @857 + WriteNdefRecord_Contact @858 + WriteNdefRecord_ContactM @859 + WriteNdefRecord_Email @860 + WriteNdefRecord_EmailM @861 + WriteNdefRecord_GeoLocation @862 + WriteNdefRecord_GeoLocationM @863 + WriteNdefRecord_NaviDestination @864 + WriteNdefRecord_NaviDestinationM @865 + WriteNdefRecord_Phone @866 + WriteNdefRecord_PhoneM @867 + WriteNdefRecord_SMS @868 + WriteNdefRecord_SMSM @869 + WriteNdefRecord_Skype @870 + WriteNdefRecord_SkypeM @871 + WriteNdefRecord_StreetView @872 + WriteNdefRecord_StreetViewM @873 + WriteNdefRecord_Text @874 + WriteNdefRecord_TextM @875 + WriteNdefRecord_Viber @876 + WriteNdefRecord_ViberM @877 + WriteNdefRecord_Whatsapp @878 + WriteNdefRecord_WhatsappM @879 + WriteNdefRecord_WiFi @880 + WriteNdefRecord_WiFiM @881 + WriteReaderId @882 + WriteReaderIdM @883 + WriteSamUnlockKey @884 + WriteSamUnlockKeyM @885 + WriteShareRam @886 + WriteShareRamM @887 + WriteUserData @888 + WriteUserDataExt @889 + WriteUserDataExtM @890 + WriteUserDataM @891 + ais_erase_right_record @892 + ais_erase_right_recordM @893 + ais_get_card_daily_duration @894 + ais_get_card_daily_durationM @895 + ais_get_card_number @896 + ais_get_card_numberM @897 + ais_get_card_total_duration @898 + ais_get_card_total_durationM @899 + ais_get_card_type @900 + ais_get_card_typeM @901 + ais_get_credit_and_period_validity @902 + ais_get_credit_and_period_validityM @903 + ais_get_right_record @904 + ais_get_right_recordM @905 + ais_get_right_record_type_max_daily_counter @906 + ais_get_right_record_type_max_daily_counterM @907 + ais_get_right_type_record @908 + ais_get_right_type_recordM @909 + ais_get_validate_record @910 + ais_get_validate_recordM @911 + ais_set_card_daily_duration @912 + ais_set_card_daily_durationM @913 + ais_set_card_total_duration @914 + ais_set_card_total_durationM @915 + ais_set_card_type @916 + ais_set_card_typeM @917 + ais_set_credit_and_period_validity @918 + ais_set_credit_and_period_validityM @919 + ais_set_right_record @920 + ais_set_right_recordM @921 + ais_set_right_record_type_max_daily_counter @922 + ais_set_right_record_type_max_daily_counterM @923 + ais_set_right_type_record @924 + ais_set_right_type_recordM @925 + ais_set_validate_record @926 + ais_set_validate_recordM @927 + card_halt_enable @928 + card_halt_enableM @929 + card_transceive @930 + card_transceiveM @931 + card_transceive_mode_start @932 + card_transceive_mode_startM @933 + card_transceive_mode_stop @934 + card_transceive_mode_stopM @935 + close_ISO7816_interface_APDU_ISO14443_4 @936 + close_ISO7816_interface_APDU_ISO14443_4M @937 + close_ISO7816_interface_no_APDU @938 + close_ISO7816_interface_no_APDUM @939 + desfire_check_clear_record_transaction_mac @940 + desfire_check_write_record_transaction_mac @941 + dfl_change_file_settings @942 + dfl_change_file_settingsM @943 + dfl_change_file_settings_pk @944 + dfl_change_file_settings_pkM @945 + dfl_change_tmc_file_settings @946 + dfl_change_tmc_file_settingsM @947 + dfl_change_tmc_file_settings_pk @948 + dfl_change_tmc_file_settings_pkM @949 + dfl_check_credit_value_transaction_mac @950 + dfl_check_debit_value_transaction_mac @951 + dfl_check_write_record_transaction_mac @952 + dfl_delete_tmc_file @953 + dfl_delete_tmc_fileM @954 + dfl_delete_tmc_file_pk @955 + dfl_delete_tmc_file_pkM @956 + dfl_get_file_settings @957 + erase_all_ndef_records @958 + erase_all_ndef_recordsM @959 + erase_last_ndef_record @960 + erase_last_ndef_recordM @961 + get_ndef_record_count @962 + get_ndef_record_countM @963 + i_block_trans_rcv_chain @964 + i_block_trans_rcv_chainM @965 + ndef_card_initialization @966 + ndef_card_initializationM @967 + nt4h_change_key @968 + nt4h_change_keyM @969 + nt4h_change_key_pk @970 + nt4h_change_key_pkM @971 + nt4h_change_sdm_file_settings @972 + nt4h_change_sdm_file_settingsM @973 + nt4h_change_sdm_file_settings_pk @974 + nt4h_change_sdm_file_settings_pkM @975 + nt4h_change_standard_file_settings @976 + nt4h_change_standard_file_settingsM @977 + nt4h_change_standard_file_settings_pk @978 + nt4h_change_standard_file_settings_pkM @979 + nt4h_check_sdm_mac @980 + nt4h_decrypt_picc_data @981 + nt4h_decrypt_sdm_enc_file_data @982 + nt4h_enable_tt @983 + nt4h_enable_ttM @984 + nt4h_enable_tt_pk @985 + nt4h_enable_tt_pkM @986 + nt4h_get_file_settings @987 + nt4h_get_file_settingsM @988 + nt4h_get_sdm_ctr @989 + nt4h_get_sdm_ctrM @990 + nt4h_get_sdm_ctr_no_auth @991 + nt4h_get_sdm_ctr_no_authM @992 + nt4h_get_sdm_ctr_pk @993 + nt4h_get_sdm_ctr_pkM @994 + nt4h_get_tt_status @995 + nt4h_get_tt_statusM @996 + nt4h_get_tt_status_no_auth @997 + nt4h_get_tt_status_no_authM @998 + nt4h_get_tt_status_pk @999 + nt4h_get_tt_status_pkM @1000 + nt4h_get_uid @1001 + nt4h_get_uidM @1002 + nt4h_get_uid_pk @1003 + nt4h_get_uid_pkM @1004 + nt4h_rid_read_ecc_signature @1005 + nt4h_rid_read_ecc_signatureM @1006 + nt4h_rid_read_ecc_signature_pk @1007 + nt4h_rid_read_ecc_signature_pkM @1008 + nt4h_set_global_parameters @1009 + nt4h_set_global_parametersM @1010 + nt4h_set_rid @1011 + nt4h_set_ridM @1012 + nt4h_set_rid_pk @1013 + nt4h_set_rid_pkM @1014 + nt4h_tt_change_sdm_file_settings @1015 + nt4h_tt_change_sdm_file_settingsM @1016 + nt4h_tt_change_sdm_file_settings_pk @1017 + nt4h_tt_change_sdm_file_settings_pkM @1018 + nt4h_tt_get_file_settings @1019 + nt4h_tt_get_file_settingsM @1020 + nt4h_unset_rid_pk @1021 + open_ISO7816_interface @1022 + open_ISO7816_interfaceM @1023 + r_block_transceive @1024 + r_block_transceiveM @1025 + read_ndef_record @1026 + read_ndef_recordM @1027 + s_block_deselect @1028 + s_block_deselectM @1029 + setCardDetectedCallback @1030 + setCardRemovedCallback @1031 + setSessionErrorCallback @1032 + test_desfire_ver @1033 + test_i_block @1034 + uFR_APDU_Start @1035 + uFR_APDU_StartM @1036 + uFR_APDU_Stop @1037 + uFR_APDU_StopM @1038 + uFR_APDU_Transceive @1039 + uFR_APDU_TransceiveM @1040 + uFR_DESFIRE_Start @1041 + uFR_DESFIRE_StartM @1042 + uFR_DESFIRE_Stop @1043 + uFR_DESFIRE_StopM @1044 + uFR_SAM_DesfireChange2k3desKey_2k3desAuth @1045 + uFR_SAM_DesfireChange2k3desKey_2k3desAuthM @1046 + uFR_SAM_DesfireChange2k3desKey_DesAuth @1047 + uFR_SAM_DesfireChange2k3desKey_DesAuthM @1048 + uFR_SAM_DesfireChange3k3desKey_3k3desAuth @1049 + uFR_SAM_DesfireChange3k3desKey_3k3desAuthM @1050 + uFR_SAM_DesfireChangeAesKey_AesAuth @1051 + uFR_SAM_DesfireChangeDesKey_2k3desAuth @1052 + uFR_SAM_DesfireChangeDesKey_2k3desAuthM @1053 + uFR_SAM_DesfireChangeDesKey_DesAuth @1054 + uFR_SAM_DesfireChangeDesKey_DesAuthM @1055 + uFR_SAM_DesfireChangeFileSettings2k3desAuth @1056 + uFR_SAM_DesfireChangeFileSettings2k3desAuthM @1057 + uFR_SAM_DesfireChangeFileSettings3k3desAuth @1058 + uFR_SAM_DesfireChangeFileSettings3k3desAuthM @1059 + uFR_SAM_DesfireChangeFileSettingsAesAuth @1060 + uFR_SAM_DesfireChangeFileSettingsAesAuthM @1061 + uFR_SAM_DesfireChangeFileSettingsDesAuth @1062 + uFR_SAM_DesfireChangeFileSettingsDesAuthM @1063 + uFR_SAM_DesfireChangeFileSettingsSdm @1064 + uFR_SAM_DesfireChangeFileSettingsSdmM @1065 + uFR_SAM_DesfireChangeKeySettings2k3desAuth @1066 + uFR_SAM_DesfireChangeKeySettings2k3desAuthM @1067 + uFR_SAM_DesfireChangeKeySettings3k3desAuth @1068 + uFR_SAM_DesfireChangeKeySettings3k3desAuthM @1069 + uFR_SAM_DesfireChangeKeySettingsAesAuth @1070 + uFR_SAM_DesfireChangeKeySettingsAesAuthM @1071 + uFR_SAM_DesfireChangeKeySettingsDesAuth @1072 + uFR_SAM_DesfireChangeKeySettingsDesAuthM @1073 + uFR_SAM_DesfireChangeKey_AesAuthM @1074 + uFR_SAM_DesfireChangeMasterKey @1075 + uFR_SAM_DesfireChangeMasterKeyM @1076 + uFR_SAM_DesfireClearRecordFile2k3desAuth @1077 + uFR_SAM_DesfireClearRecordFile2k3desAuth_2 @1078 + uFR_SAM_DesfireClearRecordFile2k3desAuth_2M @1079 + uFR_SAM_DesfireClearRecordFile3k3desAuth @1080 + uFR_SAM_DesfireClearRecordFile3k3desAuthM @1081 + uFR_SAM_DesfireClearRecordFile3k3desAuth_2 @1082 + uFR_SAM_DesfireClearRecordFile3k3desAuth_2M @1083 + uFR_SAM_DesfireClearRecordFileAesAuth @1084 + uFR_SAM_DesfireClearRecordFileAesAuthM @1085 + uFR_SAM_DesfireClearRecordFileAesAuth_2 @1086 + uFR_SAM_DesfireClearRecordFileAesAuth_2M @1087 + uFR_SAM_DesfireClearRecordFileDesAuth @1088 + uFR_SAM_DesfireClearRecordFileDesAuth_2 @1089 + uFR_SAM_DesfireClearRecordFileDesAuth_2M @1090 + uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuth @1091 + uFR_SAM_DesfireClearRecordFile_TransMac_2k3desAuthM @1092 + uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuth @1093 + uFR_SAM_DesfireClearRecordFile_TransMac_3k3desAuthM @1094 + uFR_SAM_DesfireClearRecordFile_TransMac_AesAuth @1095 + uFR_SAM_DesfireClearRecordFile_TransMac_AesAuthM @1096 + uFR_SAM_DesfireClearRecordFile_TransMac_DesAuth @1097 + uFR_SAM_DesfireClearRecordFile_TransMac_DesAuthM @1098 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuth @1099 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIso @1100 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthIsoM @1101 + uFR_SAM_DesfireCreate3k3desApplication2k3desAuthM @1102 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuth @1103 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIso @1104 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthIsoM @1105 + uFR_SAM_DesfireCreate3k3desApplication3k3desAuthM @1106 + uFR_SAM_DesfireCreate3k3desApplicationAesAuth @1107 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthIso @1108 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthIsoM @1109 + uFR_SAM_DesfireCreate3k3desApplicationAesAuthM @1110 + uFR_SAM_DesfireCreate3k3desApplicationDesAuth @1111 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthIso @1112 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthIsoM @1113 + uFR_SAM_DesfireCreate3k3desApplicationDesAuthM @1114 + uFR_SAM_DesfireCreateAesApplication2k3desAuth @1115 + uFR_SAM_DesfireCreateAesApplication2k3desAuthIso @1116 + uFR_SAM_DesfireCreateAesApplication2k3desAuthIsoM @1117 + uFR_SAM_DesfireCreateAesApplication2k3desAuthM @1118 + uFR_SAM_DesfireCreateAesApplication3k3desAuth @1119 + uFR_SAM_DesfireCreateAesApplication3k3desAuthIso @1120 + uFR_SAM_DesfireCreateAesApplication3k3desAuthIsoM @1121 + uFR_SAM_DesfireCreateAesApplication3k3desAuthM @1122 + uFR_SAM_DesfireCreateAesApplicationAesAuth @1123 + uFR_SAM_DesfireCreateAesApplicationAesAuthIso @1124 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscd @1125 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoAscdM @1126 + uFR_SAM_DesfireCreateAesApplicationAesAuthIsoM @1127 + uFR_SAM_DesfireCreateAesApplicationAesAuthM @1128 + uFR_SAM_DesfireCreateAesApplicationDesAuth @1129 + uFR_SAM_DesfireCreateAesApplicationDesAuthIso @1130 + uFR_SAM_DesfireCreateAesApplicationDesAuthIsoM @1131 + uFR_SAM_DesfireCreateAesApplicationDesAuthM @1132 + uFR_SAM_DesfireCreateBackupDataFile2k3desAuth @1133 + uFR_SAM_DesfireCreateBackupDataFile2k3desAuthM @1134 + uFR_SAM_DesfireCreateBackupDataFile3k3desAuth @1135 + uFR_SAM_DesfireCreateBackupDataFile3k3desAuthM @1136 + uFR_SAM_DesfireCreateBackupDataFileAesAuth @1137 + uFR_SAM_DesfireCreateBackupDataFileAesAuthM @1138 + uFR_SAM_DesfireCreateBackupDataFileDesAuth @1139 + uFR_SAM_DesfireCreateBackupdDataFileDesAuthM @1140 + uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuth @1141 + uFR_SAM_DesfireCreateCyclicRecordFile2k3desAuthM @1142 + uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuth @1143 + uFR_SAM_DesfireCreateCyclicRecordFile3k3desAuthM @1144 + uFR_SAM_DesfireCreateCyclicRecordFileAesAuth @1145 + uFR_SAM_DesfireCreateCyclicRecordFileAesAuthM @1146 + uFR_SAM_DesfireCreateCyclicRecordFileDesAuth @1147 + uFR_SAM_DesfireCreateCyclicRecordFileDesAuthM @1148 + uFR_SAM_DesfireCreateDesApplication2k3desAuth @1149 + uFR_SAM_DesfireCreateDesApplication2k3desAuthIso @1150 + uFR_SAM_DesfireCreateDesApplication2k3desAuthIsoM @1151 + uFR_SAM_DesfireCreateDesApplication2k3desAuthM @1152 + uFR_SAM_DesfireCreateDesApplication3k3desAuth @1153 + uFR_SAM_DesfireCreateDesApplication3k3desAuthIso @1154 + uFR_SAM_DesfireCreateDesApplication3k3desAuthIsoM @1155 + uFR_SAM_DesfireCreateDesApplication3k3desAuthM @1156 + uFR_SAM_DesfireCreateDesApplicationAesAuth @1157 + uFR_SAM_DesfireCreateDesApplicationAesAuthIso @1158 + uFR_SAM_DesfireCreateDesApplicationAesAuthIsoM @1159 + uFR_SAM_DesfireCreateDesApplicationAesAuthM @1160 + uFR_SAM_DesfireCreateDesApplicationDesAuth @1161 + uFR_SAM_DesfireCreateDesApplicationDesAuthIso @1162 + uFR_SAM_DesfireCreateDesApplicationDesAuthIsoM @1163 + uFR_SAM_DesfireCreateDesApplicationDesAuthM @1164 + uFR_SAM_DesfireCreateLinearRecordFile2k3desAuth @1165 + uFR_SAM_DesfireCreateLinearRecordFile2k3desAuthM @1166 + uFR_SAM_DesfireCreateLinearRecordFile3k3desAuth @1167 + uFR_SAM_DesfireCreateLinearRecordFile3k3desAuthM @1168 + uFR_SAM_DesfireCreateLinearRecordFileAesAuth @1169 + uFR_SAM_DesfireCreateLinearRecordFileAesAuthM @1170 + uFR_SAM_DesfireCreateLinearRecordFileDesAuth @1171 + uFR_SAM_DesfireCreateLinearRecordFileDesAuthM @1172 + uFR_SAM_DesfireCreateStdDataFile2k3desAuth @1173 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthIso @1174 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthIsoM @1175 + uFR_SAM_DesfireCreateStdDataFile2k3desAuthM @1176 + uFR_SAM_DesfireCreateStdDataFile3k3desAuth @1177 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthIso @1178 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthIsoM @1179 + uFR_SAM_DesfireCreateStdDataFile3k3desAuthM @1180 + uFR_SAM_DesfireCreateStdDataFileAesAuth @1181 + uFR_SAM_DesfireCreateStdDataFileAesAuthIso @1182 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoM @1183 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdm @1184 + uFR_SAM_DesfireCreateStdDataFileAesAuthIsoSdmM @1185 + uFR_SAM_DesfireCreateStdDataFileAesAuthM @1186 + uFR_SAM_DesfireCreateStdDataFileDesAuth @1187 + uFR_SAM_DesfireCreateStdDataFileDesAuthIso @1188 + uFR_SAM_DesfireCreateStdDataFileDesAuthIsoM @1189 + uFR_SAM_DesfireCreateStdDataFileDesAuthM @1190 + uFR_SAM_DesfireCreateTransMacFile2k3desAuth @1191 + uFR_SAM_DesfireCreateTransMacFile2k3desAuthM @1192 + uFR_SAM_DesfireCreateTransMacFile3k3desAuth @1193 + uFR_SAM_DesfireCreateTransMacFile3k3desAuthM @1194 + uFR_SAM_DesfireCreateTransMacFileAesAuth @1195 + uFR_SAM_DesfireCreateTransMacFileAesAuthM @1196 + uFR_SAM_DesfireCreateTransMacFileDesAuth @1197 + uFR_SAM_DesfireCreateTransMacFileDesAuthM @1198 + uFR_SAM_DesfireCreateValueFile2k3desAuth @1199 + uFR_SAM_DesfireCreateValueFile2k3desAuthM @1200 + uFR_SAM_DesfireCreateValueFile3k3desAuth @1201 + uFR_SAM_DesfireCreateValueFile3k3desAuthM @1202 + uFR_SAM_DesfireCreateValueFileAesAuth @1203 + uFR_SAM_DesfireCreateValueFileAesAuthM @1204 + uFR_SAM_DesfireCreateValueFileDesAuth @1205 + uFR_SAM_DesfireCreateValueFileDesAuthM @1206 + uFR_SAM_DesfireDecreaseValueFile2k3desAuth @1207 + uFR_SAM_DesfireDecreaseValueFile2k3desAuthM @1208 + uFR_SAM_DesfireDecreaseValueFile3k3desAuth @1209 + uFR_SAM_DesfireDecreaseValueFile3k3desAuthM @1210 + uFR_SAM_DesfireDecreaseValueFileAesAuth @1211 + uFR_SAM_DesfireDecreaseValueFileAesAuthM @1212 + uFR_SAM_DesfireDecreaseValueFileDesAuth @1213 + uFR_SAM_DesfireDecreaseValueFileDesAuthM @1214 + uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuth @1215 + uFR_SAM_DesfireDecreaseValueFile_TransMac_2k3desAuthM @1216 + uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuth @1217 + uFR_SAM_DesfireDecreaseValueFile_TransMac_3k3desAuthM @1218 + uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuth @1219 + uFR_SAM_DesfireDecreaseValueFile_TransMac_AesAuthM @1220 + uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuth @1221 + uFR_SAM_DesfireDecreaseValueFile_TransMac_DesAuthM @1222 + uFR_SAM_DesfireDeleteApplication2k3desAuth @1223 + uFR_SAM_DesfireDeleteApplication2k3desAuthM @1224 + uFR_SAM_DesfireDeleteApplication3k3desAuth @1225 + uFR_SAM_DesfireDeleteApplication3k3desAuthM @1226 + uFR_SAM_DesfireDeleteApplicationAesAuth @1227 + uFR_SAM_DesfireDeleteApplicationAesAuthM @1228 + uFR_SAM_DesfireDeleteApplicationDesAuth @1229 + uFR_SAM_DesfireDeleteApplicationDesAuthM @1230 + uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuth @1231 + uFR_SAM_DesfireDeleteApplication_app_master_2k3desAuthM @1232 + uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuth @1233 + uFR_SAM_DesfireDeleteApplication_app_master_3k3desAuthM @1234 + uFR_SAM_DesfireDeleteApplication_app_master_AesAuth @1235 + uFR_SAM_DesfireDeleteApplication_app_master_AesAuthM @1236 + uFR_SAM_DesfireDeleteApplication_app_master_DesAuth @1237 + uFR_SAM_DesfireDeleteApplication_app_master_DesAuthM @1238 + uFR_SAM_DesfireDeleteFile2k3desAuth @1239 + uFR_SAM_DesfireDeleteFile2k3desAuthM @1240 + uFR_SAM_DesfireDeleteFile3k3desAuth @1241 + uFR_SAM_DesfireDeleteFile3k3desAuthM @1242 + uFR_SAM_DesfireDeleteFileAesAuth @1243 + uFR_SAM_DesfireDeleteFileAesAuthM @1244 + uFR_SAM_DesfireDeleteFileDesAuth @1245 + uFR_SAM_DesfireDeleteFileDesAuthM @1246 + uFR_SAM_DesfireFormatCard2k3desAuth @1247 + uFR_SAM_DesfireFormatCard2k3desAuthM @1248 + uFR_SAM_DesfireFormatCard3k3desAuth @1249 + uFR_SAM_DesfireFormatCard3k3desAuthM @1250 + uFR_SAM_DesfireFormatCardAesAuth @1251 + uFR_SAM_DesfireFormatCardAesAuthM @1252 + uFR_SAM_DesfireFormatCardDesAuth @1253 + uFR_SAM_DesfireFormatCardDesAuthM @1254 + uFR_SAM_DesfireGetApplicationIds2k3desAuth @1255 + uFR_SAM_DesfireGetApplicationIds2k3desAuthM @1256 + uFR_SAM_DesfireGetApplicationIds3k3desAuth @1257 + uFR_SAM_DesfireGetApplicationIds3k3desAuthM @1258 + uFR_SAM_DesfireGetApplicationIdsAesAuth @1259 + uFR_SAM_DesfireGetApplicationIdsAesAuthM @1260 + uFR_SAM_DesfireGetApplicationIdsDesAuth @1261 + uFR_SAM_DesfireGetApplicationIdsDesAuthM @1262 + uFR_SAM_DesfireGetFileSettings2k3desAuth @1263 + uFR_SAM_DesfireGetFileSettings2k3desAuthM @1264 + uFR_SAM_DesfireGetFileSettings3k3desAuth @1265 + uFR_SAM_DesfireGetFileSettings3k3desAuthM @1266 + uFR_SAM_DesfireGetFileSettingsAesAuth @1267 + uFR_SAM_DesfireGetFileSettingsAesAuthM @1268 + uFR_SAM_DesfireGetFileSettingsDesAuth @1269 + uFR_SAM_DesfireGetFileSettingsDesAuthM @1270 + uFR_SAM_DesfireGetFileSettingsSdmAesAuth @1271 + uFR_SAM_DesfireGetFileSettingsSdmAesAuthM @1272 + uFR_SAM_DesfireGetKeySettings2k3desAuth @1273 + uFR_SAM_DesfireGetKeySettings2k3desAuthM @1274 + uFR_SAM_DesfireGetKeySettings3k3desAuth @1275 + uFR_SAM_DesfireGetKeySettings3k3desAuthM @1276 + uFR_SAM_DesfireGetKeySettingsAesAuth @1277 + uFR_SAM_DesfireGetKeySettingsAesAuthM @1278 + uFR_SAM_DesfireGetKeySettingsDesAuth @1279 + uFR_SAM_DesfireGetKeySettingsDesAuthM @1280 + uFR_SAM_DesfireGetStdFileSize2k3desAuth @1281 + uFR_SAM_DesfireGetStdFileSize2k3desAuthM @1282 + uFR_SAM_DesfireGetStdFileSize3k3desAuth @1283 + uFR_SAM_DesfireGetStdFileSize3k3desAuthM @1284 + uFR_SAM_DesfireGetStdFileSizeAesAuth @1285 + uFR_SAM_DesfireGetStdFileSizeAesAuthM @1286 + uFR_SAM_DesfireGetStdFileSizeDesAuth @1287 + uFR_SAM_DesfireGetStdFileSizeDesAuthM @1288 + uFR_SAM_DesfireIncreaseValueFile2k3desAuth @1289 + uFR_SAM_DesfireIncreaseValueFile2k3desAuthM @1290 + uFR_SAM_DesfireIncreaseValueFile3k3desAuth @1291 + uFR_SAM_DesfireIncreaseValueFile3k3desAuthM @1292 + uFR_SAM_DesfireIncreaseValueFileAesAuth @1293 + uFR_SAM_DesfireIncreaseValueFileAesAuthM @1294 + uFR_SAM_DesfireIncreaseValueFileDesAuth @1295 + uFR_SAM_DesfireIncreaseValueFileDesAuthM @1296 + uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuth @1297 + uFR_SAM_DesfireIncreaseValueFile_TransMac_2k3desAuthM @1298 + uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuth @1299 + uFR_SAM_DesfireIncreaseValueFile_TransMac_3k3desAuthM @1300 + uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuth @1301 + uFR_SAM_DesfireIncreaseValueFile_TransMac_AesAuthM @1302 + uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuth @1303 + uFR_SAM_DesfireIncreaseValueFile_TransMac_DesAuthM @1304 + uFR_SAM_DesfireReadRecords2k3desAuth @1305 + uFR_SAM_DesfireReadRecords2k3desAuthM @1306 + uFR_SAM_DesfireReadRecords3k3desAuth @1307 + uFR_SAM_DesfireReadRecords3k3desAuthM @1308 + uFR_SAM_DesfireReadRecordsAesAuth @1309 + uFR_SAM_DesfireReadRecordsAesAuthM @1310 + uFR_SAM_DesfireReadRecordsDesAuth @1311 + uFR_SAM_DesfireReadRecordsDesAuthM @1312 + uFR_SAM_DesfireReadStdDataFile2k3desAuth @1313 + uFR_SAM_DesfireReadStdDataFile2k3desAuthM @1314 + uFR_SAM_DesfireReadStdDataFile3k3desAuth @1315 + uFR_SAM_DesfireReadStdDataFile3k3desAuthM @1316 + uFR_SAM_DesfireReadStdDataFileAesAuth @1317 + uFR_SAM_DesfireReadStdDataFileAesAuthM @1318 + uFR_SAM_DesfireReadStdDataFileDesAuth @1319 + uFR_SAM_DesfireReadStdDataFileDesAuthM @1320 + uFR_SAM_DesfireReadValueFile2k3desAuth @1321 + uFR_SAM_DesfireReadValueFile2k3desAuthM @1322 + uFR_SAM_DesfireReadValueFile3k3desAuth @1323 + uFR_SAM_DesfireReadValueFile3k3desAuthM @1324 + uFR_SAM_DesfireReadValueFileAesAuth @1325 + uFR_SAM_DesfireReadValueFileAesAuthM @1326 + uFR_SAM_DesfireReadValueFileDesAuth @1327 + uFR_SAM_DesfireReadValueFileDesAuthM @1328 + uFR_SAM_DesfireSetConfiguration2k3desAuth @1329 + uFR_SAM_DesfireSetConfiguration2k3desAuthM @1330 + uFR_SAM_DesfireSetConfiguration3k3desAuth @1331 + uFR_SAM_DesfireSetConfiguration3k3desAuthM @1332 + uFR_SAM_DesfireSetConfigurationAesAuth @1333 + uFR_SAM_DesfireSetConfigurationAesAuthM @1334 + uFR_SAM_DesfireSetConfigurationDesAuth @1335 + uFR_SAM_DesfireSetConfigurationDesAuthM @1336 + uFR_SAM_DesfireSetTransactionTimerAesAuth @1337 + uFR_SAM_DesfireSetTransactionTimerAesAuthM @1338 + uFR_SAM_DesfireWriteBackupDataFile2k3desAuth @1339 + uFR_SAM_DesfireWriteBackupDataFile2k3desAuthM @1340 + uFR_SAM_DesfireWriteBackupDataFile3k3desAuth @1341 + uFR_SAM_DesfireWriteBackupDataFile3k3desAuthM @1342 + uFR_SAM_DesfireWriteBackupDataFileAesAuth @1343 + uFR_SAM_DesfireWriteBackupDataFileAesAuthM @1344 + uFR_SAM_DesfireWriteBackupDataFileDesAuth @1345 + uFR_SAM_DesfireWriteBackupDataFileDesAuthM @1346 + uFR_SAM_DesfireWriteRecord2k3desAuth @1347 + uFR_SAM_DesfireWriteRecord2k3desAuthM @1348 + uFR_SAM_DesfireWriteRecord3k3desAuth @1349 + uFR_SAM_DesfireWriteRecord3k3desAuthM @1350 + uFR_SAM_DesfireWriteRecordAesAuth @1351 + uFR_SAM_DesfireWriteRecordAesAuthM @1352 + uFR_SAM_DesfireWriteRecordDesAuth @1353 + uFR_SAM_DesfireWriteRecordDesAuthM @1354 + uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuth @1355 + uFR_SAM_DesfireWriteRecord_TransMac_2k3desAuthM @1356 + uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuth @1357 + uFR_SAM_DesfireWriteRecord_TransMac_3k3desAuthM @1358 + uFR_SAM_DesfireWriteRecord_TransMac_AesAuth @1359 + uFR_SAM_DesfireWriteRecord_TransMac_AesAuthM @1360 + uFR_SAM_DesfireWriteRecord_TransMac_DesAuth @1361 + uFR_SAM_DesfireWriteRecord_TransMac_DesAuthM @1362 + uFR_SAM_DesfireWriteStdDataFile2k3desAuth @1363 + uFR_SAM_DesfireWriteStdDataFile2k3desAuthM @1364 + uFR_SAM_DesfireWriteStdDataFile3k3desAuth @1365 + uFR_SAM_DesfireWriteStdDataFile3k3desAuthM @1366 + uFR_SAM_DesfireWriteStdDataFileAesAuth @1367 + uFR_SAM_DesfireWriteStdDataFileAesAuthM @1368 + uFR_SAM_DesfireWriteStdDataFileDesAuth @1369 + uFR_SAM_DesfireWriteStdDataFileDesAuthM @1370 + uFR_SAM_GetDesfireUid2k3desAuth @1371 + uFR_SAM_GetDesfireUid2k3desAuthM @1372 + uFR_SAM_GetDesfireUid3k3desAuth @1373 + uFR_SAM_GetDesfireUid3k3desAuthM @1374 + uFR_SAM_GetDesfireUidAesAuth @1375 + uFR_SAM_GetDesfireUidAesAuthM @1376 + uFR_SAM_GetDesfireUidDesAuth @1377 + uFR_SAM_GetDesfireUidDesAuthM @1378 + uFR_i_block_transceive @1379 + uFR_i_block_transceiveM @1380 + uFR_int_DesfireChange2K3DesKey_2k3des @1381 + uFR_int_DesfireChange2K3DesKey_2k3desM @1382 + uFR_int_DesfireChange2K3DesKey_2k3des_PK @1383 + uFR_int_DesfireChange2K3DesKey_2k3des_PK_M @1384 + uFR_int_DesfireChange2K3DesKey_des @1385 + uFR_int_DesfireChange2K3DesKey_desM @1386 + uFR_int_DesfireChange2K3DesKey_des_PK @1387 + uFR_int_DesfireChange2K3DesKey_des_PK_M @1388 + uFR_int_DesfireChange3K3DesKey_3k3des @1389 + uFR_int_DesfireChange3K3DesKey_3k3desM @1390 + uFR_int_DesfireChange3K3DesKey_3k3des_PK @1391 + uFR_int_DesfireChange3K3DesKey_3k3des_PK_M @1392 + uFR_int_DesfireChangeAesKey @1393 + uFR_int_DesfireChangeAesKeyM @1394 + uFR_int_DesfireChangeAesKey_A @1395 + uFR_int_DesfireChangeAesKey_PK @1396 + uFR_int_DesfireChangeAesKey_PK_M @1397 + uFR_int_DesfireChangeAesKey_aes @1398 + uFR_int_DesfireChangeAesKey_aesM @1399 + uFR_int_DesfireChangeAesKey_aes_PK @1400 + uFR_int_DesfireChangeAesKey_aes_PK_M @1401 + uFR_int_DesfireChangeDesKey_2k3des @1402 + uFR_int_DesfireChangeDesKey_2k3desM @1403 + uFR_int_DesfireChangeDesKey_2k3des_PK @1404 + uFR_int_DesfireChangeDesKey_2k3des_PK_M @1405 + uFR_int_DesfireChangeDesKey_des @1406 + uFR_int_DesfireChangeDesKey_desM @1407 + uFR_int_DesfireChangeDesKey_des_PK @1408 + uFR_int_DesfireChangeDesKey_des_PK_M @1409 + uFR_int_DesfireChangeFileSettingsSdm @1410 + uFR_int_DesfireChangeFileSettingsSdmM @1411 + uFR_int_DesfireChangeFileSettingsSdm_PK @1412 + uFR_int_DesfireChangeFileSettingsSdm_PK_M @1413 + uFR_int_DesfireChangeFileSettings_2k3des @1414 + uFR_int_DesfireChangeFileSettings_2k3desM @1415 + uFR_int_DesfireChangeFileSettings_2k3des_PK @1416 + uFR_int_DesfireChangeFileSettings_2k3des_PK_M @1417 + uFR_int_DesfireChangeFileSettings_3k3des @1418 + uFR_int_DesfireChangeFileSettings_3k3desM @1419 + uFR_int_DesfireChangeFileSettings_3k3des_PK @1420 + uFR_int_DesfireChangeFileSettings_3k3des_PK_M @1421 + uFR_int_DesfireChangeFileSettings_aes @1422 + uFR_int_DesfireChangeFileSettings_aesM @1423 + uFR_int_DesfireChangeFileSettings_aes_PK @1424 + uFR_int_DesfireChangeFileSettings_aes_PK_M @1425 + uFR_int_DesfireChangeFileSettings_des @1426 + uFR_int_DesfireChangeFileSettings_desM @1427 + uFR_int_DesfireChangeFileSettings_des_PK @1428 + uFR_int_DesfireChangeFileSettings_des_PK_M @1429 + uFR_int_DesfireChangeKeySettings @1430 + uFR_int_DesfireChangeKeySettingsM @1431 + uFR_int_DesfireChangeKeySettings_2k3des @1432 + uFR_int_DesfireChangeKeySettings_2k3desM @1433 + uFR_int_DesfireChangeKeySettings_2k3des_PK @1434 + uFR_int_DesfireChangeKeySettings_2k3des_PK_M @1435 + uFR_int_DesfireChangeKeySettings_3k3des @1436 + uFR_int_DesfireChangeKeySettings_3k3desM @1437 + uFR_int_DesfireChangeKeySettings_3k3des_PK @1438 + uFR_int_DesfireChangeKeySettings_3k3des_PK_M @1439 + uFR_int_DesfireChangeKeySettings_PK @1440 + uFR_int_DesfireChangeKeySettings_PK_M @1441 + uFR_int_DesfireChangeKeySettings_aes @1442 + uFR_int_DesfireChangeKeySettings_aesM @1443 + uFR_int_DesfireChangeKeySettings_aes_PK @1444 + uFR_int_DesfireChangeKeySettings_aes_PK_M @1445 + uFR_int_DesfireChangeKeySettings_des @1446 + uFR_int_DesfireChangeKeySettings_desM @1447 + uFR_int_DesfireChangeKeySettings_des_PK @1448 + uFR_int_DesfireChangeKeySettings_des_PK_M @1449 + uFR_int_DesfireChangeMasterKey @1450 + uFR_int_DesfireChangeMasterKeyM @1451 + uFR_int_DesfireChangeMasterKey_PK @1452 + uFR_int_DesfireChangeMasterKey_PK_M @1453 + uFR_int_DesfireClearRecordFile @1454 + uFR_int_DesfireClearRecordFile_2k3des @1455 + uFR_int_DesfireClearRecordFile_2k3desM @1456 + uFR_int_DesfireClearRecordFile_2k3des_2 @1457 + uFR_int_DesfireClearRecordFile_2k3des_2M @1458 + uFR_int_DesfireClearRecordFile_2k3des_PK @1459 + uFR_int_DesfireClearRecordFile_2k3des_PK_2 @1460 + uFR_int_DesfireClearRecordFile_2k3des_PK_2M @1461 + uFR_int_DesfireClearRecordFile_2k3des_PK_M @1462 + uFR_int_DesfireClearRecordFile_3k3des @1463 + uFR_int_DesfireClearRecordFile_3k3desM @1464 + uFR_int_DesfireClearRecordFile_3k3des_2 @1465 + uFR_int_DesfireClearRecordFile_3k3des_2M @1466 + uFR_int_DesfireClearRecordFile_3k3des_PK @1467 + uFR_int_DesfireClearRecordFile_3k3des_PK_2 @1468 + uFR_int_DesfireClearRecordFile_3k3des_PK_2M @1469 + uFR_int_DesfireClearRecordFile_3k3des_PK_M @1470 + uFR_int_DesfireClearRecordFile_PK @1471 + uFR_int_DesfireClearRecordFile_PK_2 @1472 + uFR_int_DesfireClearRecordFile_TransMac_2k3des @1473 + uFR_int_DesfireClearRecordFile_TransMac_2k3desM @1474 + uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK @1475 + uFR_int_DesfireClearRecordFile_TransMac_2k3des_PK_M @1476 + uFR_int_DesfireClearRecordFile_TransMac_3k3des @1477 + uFR_int_DesfireClearRecordFile_TransMac_3k3desM @1478 + uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK @1479 + uFR_int_DesfireClearRecordFile_TransMac_3k3des_PK_M @1480 + uFR_int_DesfireClearRecordFile_TransMac_aes @1481 + uFR_int_DesfireClearRecordFile_TransMac_aesM @1482 + uFR_int_DesfireClearRecordFile_TransMac_aes_PK @1483 + uFR_int_DesfireClearRecordFile_TransMac_aes_PK_M @1484 + uFR_int_DesfireClearRecordFile_TransMac_des @1485 + uFR_int_DesfireClearRecordFile_TransMac_desM @1486 + uFR_int_DesfireClearRecordFile_TransMac_des_PK @1487 + uFR_int_DesfireClearRecordFile_TransMac_des_PK_M @1488 + uFR_int_DesfireClearRecordFile_TransMac_no_auth @1489 + uFR_int_DesfireClearRecordFile_TransMac_no_auth_M @1490 + uFR_int_DesfireClearRecordFile_aes @1491 + uFR_int_DesfireClearRecordFile_aesM @1492 + uFR_int_DesfireClearRecordFile_aes_2 @1493 + uFR_int_DesfireClearRecordFile_aes_2M @1494 + uFR_int_DesfireClearRecordFile_aes_PK @1495 + uFR_int_DesfireClearRecordFile_aes_PK_2 @1496 + uFR_int_DesfireClearRecordFile_aes_PK_2M @1497 + uFR_int_DesfireClearRecordFile_aes_PK_M @1498 + uFR_int_DesfireClearRecordFile_des @1499 + uFR_int_DesfireClearRecordFile_desM @1500 + uFR_int_DesfireClearRecordFile_des_2 @1501 + uFR_int_DesfireClearRecordFile_des_2M @1502 + uFR_int_DesfireClearRecordFile_des_PK @1503 + uFR_int_DesfireClearRecordFile_des_PK_2 @1504 + uFR_int_DesfireClearRecordFile_des_PK_2M @1505 + uFR_int_DesfireClearRecordFile_des_PK_M @1506 + uFR_int_DesfireClearRecordFile_no_auth @1507 + uFR_int_DesfireClearRecordFile_no_authM @1508 + uFR_int_DesfireCreate3k3desApplication_2k3des @1509 + uFR_int_DesfireCreate3k3desApplication_2k3desM @1510 + uFR_int_DesfireCreate3k3desApplication_2k3des_PK @1511 + uFR_int_DesfireCreate3k3desApplication_2k3des_PK_M @1512 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso @1513 + uFR_int_DesfireCreate3k3desApplication_2k3des_isoM @1514 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK @1515 + uFR_int_DesfireCreate3k3desApplication_2k3des_iso_PK_M @1516 + uFR_int_DesfireCreate3k3desApplication_3k3des @1517 + uFR_int_DesfireCreate3k3desApplication_3k3desM @1518 + uFR_int_DesfireCreate3k3desApplication_3k3des_PK @1519 + uFR_int_DesfireCreate3k3desApplication_3k3des_PK_M @1520 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso @1521 + uFR_int_DesfireCreate3k3desApplication_3k3des_isoM @1522 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK @1523 + uFR_int_DesfireCreate3k3desApplication_3k3des_iso_PK_M @1524 + uFR_int_DesfireCreate3k3desApplication_aes @1525 + uFR_int_DesfireCreate3k3desApplication_aesM @1526 + uFR_int_DesfireCreate3k3desApplication_aes_PK @1527 + uFR_int_DesfireCreate3k3desApplication_aes_PK_M @1528 + uFR_int_DesfireCreate3k3desApplication_aes_iso @1529 + uFR_int_DesfireCreate3k3desApplication_aes_isoM @1530 + uFR_int_DesfireCreate3k3desApplication_aes_iso_PK @1531 + uFR_int_DesfireCreate3k3desApplication_aes_iso_PK_M @1532 + uFR_int_DesfireCreate3k3desApplication_des @1533 + uFR_int_DesfireCreate3k3desApplication_desM @1534 + uFR_int_DesfireCreate3k3desApplication_des_PK @1535 + uFR_int_DesfireCreate3k3desApplication_des_PK_M @1536 + uFR_int_DesfireCreate3k3desApplication_des_iso @1537 + uFR_int_DesfireCreate3k3desApplication_des_isoM @1538 + uFR_int_DesfireCreate3k3desApplication_des_iso_PK @1539 + uFR_int_DesfireCreate3k3desApplication_des_iso_PK_M @1540 + uFR_int_DesfireCreate3k3desApplication_no_auth @1541 + uFR_int_DesfireCreate3k3desApplication_no_auth_M @1542 + uFR_int_DesfireCreate3k3desApplication_no_auth_iso @1543 + uFR_int_DesfireCreate3k3desApplication_no_auth_isoM @1544 + uFR_int_DesfireCreateAesApplication @1545 + uFR_int_DesfireCreateAesApplicationM @1546 + uFR_int_DesfireCreateAesApplication_2k3des @1547 + uFR_int_DesfireCreateAesApplication_2k3desM @1548 + uFR_int_DesfireCreateAesApplication_2k3des_PK @1549 + uFR_int_DesfireCreateAesApplication_2k3des_PK_M @1550 + uFR_int_DesfireCreateAesApplication_2k3des_iso @1551 + uFR_int_DesfireCreateAesApplication_2k3des_isoM @1552 + uFR_int_DesfireCreateAesApplication_2k3des_iso_PK @1553 + uFR_int_DesfireCreateAesApplication_2k3des_iso_PK_M @1554 + uFR_int_DesfireCreateAesApplication_3k3des @1555 + uFR_int_DesfireCreateAesApplication_3k3desM @1556 + uFR_int_DesfireCreateAesApplication_3k3des_PK @1557 + uFR_int_DesfireCreateAesApplication_3k3des_PK_M @1558 + uFR_int_DesfireCreateAesApplication_3k3des_iso @1559 + uFR_int_DesfireCreateAesApplication_3k3des_isoM @1560 + uFR_int_DesfireCreateAesApplication_3k3des_iso_PK @1561 + uFR_int_DesfireCreateAesApplication_3k3des_iso_PK_M @1562 + uFR_int_DesfireCreateAesApplication_PK @1563 + uFR_int_DesfireCreateAesApplication_PK_M @1564 + uFR_int_DesfireCreateAesApplication_aes @1565 + uFR_int_DesfireCreateAesApplication_aesM @1566 + uFR_int_DesfireCreateAesApplication_aes_PK @1567 + uFR_int_DesfireCreateAesApplication_aes_PK_M @1568 + uFR_int_DesfireCreateAesApplication_aes_iso @1569 + uFR_int_DesfireCreateAesApplication_aes_isoM @1570 + uFR_int_DesfireCreateAesApplication_aes_iso_PK @1571 + uFR_int_DesfireCreateAesApplication_aes_iso_PK_M @1572 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd @1573 + uFR_int_DesfireCreateAesApplication_aes_iso_ascdM @1574 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK @1575 + uFR_int_DesfireCreateAesApplication_aes_iso_ascd_PK_M @1576 + uFR_int_DesfireCreateAesApplication_des @1577 + uFR_int_DesfireCreateAesApplication_desM @1578 + uFR_int_DesfireCreateAesApplication_des_PK @1579 + uFR_int_DesfireCreateAesApplication_des_PK_M @1580 + uFR_int_DesfireCreateAesApplication_des_iso @1581 + uFR_int_DesfireCreateAesApplication_des_isoM @1582 + uFR_int_DesfireCreateAesApplication_des_iso_PK @1583 + uFR_int_DesfireCreateAesApplication_des_iso_PK_M @1584 + uFR_int_DesfireCreateAesApplication_no_auth @1585 + uFR_int_DesfireCreateAesApplication_no_auth_M @1586 + uFR_int_DesfireCreateAesApplication_no_auth_iso @1587 + uFR_int_DesfireCreateAesApplication_no_auth_isoM @1588 + uFR_int_DesfireCreateBackupDataFile_2k3des @1589 + uFR_int_DesfireCreateBackupDataFile_2k3desM @1590 + uFR_int_DesfireCreateBackupDataFile_2k3des_PK @1591 + uFR_int_DesfireCreateBackupDataFile_2k3des_PK_M @1592 + uFR_int_DesfireCreateBackupDataFile_3k3des @1593 + uFR_int_DesfireCreateBackupDataFile_3k3desM @1594 + uFR_int_DesfireCreateBackupDataFile_3k3des_PK @1595 + uFR_int_DesfireCreateBackupDataFile_3k3des_PK_M @1596 + uFR_int_DesfireCreateBackupDataFile_PK @1597 + uFR_int_DesfireCreateBackupDataFile_aes @1598 + uFR_int_DesfireCreateBackupDataFile_aesM @1599 + uFR_int_DesfireCreateBackupDataFile_aes_PK @1600 + uFR_int_DesfireCreateBackupDataFile_aes_PK_M @1601 + uFR_int_DesfireCreateBackupDataFile_des @1602 + uFR_int_DesfireCreateBackupDataFile_desM @1603 + uFR_int_DesfireCreateBackupDataFile_des_PK @1604 + uFR_int_DesfireCreateBackupDataFile_des_PK_M @1605 + uFR_int_DesfireCreateBackupDataFile_no_auth @1606 + uFR_int_DesfireCreateBackupDataFile_no_auth_M @1607 + uFR_int_DesfireCreateCyclicRecordFile_2k3des @1608 + uFR_int_DesfireCreateCyclicRecordFile_2k3desM @1609 + uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK @1610 + uFR_int_DesfireCreateCyclicRecordFile_2k3des_PK_M @1611 + uFR_int_DesfireCreateCyclicRecordFile_3k3des @1612 + uFR_int_DesfireCreateCyclicRecordFile_3k3desM @1613 + uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK @1614 + uFR_int_DesfireCreateCyclicRecordFile_3k3des_PK_M @1615 + uFR_int_DesfireCreateCyclicRecordFile_aes @1616 + uFR_int_DesfireCreateCyclicRecordFile_aesM @1617 + uFR_int_DesfireCreateCyclicRecordFile_aes_PK @1618 + uFR_int_DesfireCreateCyclicRecordFile_aes_PK_M @1619 + uFR_int_DesfireCreateCyclicRecordFile_des @1620 + uFR_int_DesfireCreateCyclicRecordFile_desM @1621 + uFR_int_DesfireCreateCyclicRecordFile_des_PK @1622 + uFR_int_DesfireCreateCyclicRecordFile_des_PK_M @1623 + uFR_int_DesfireCreateCyclicRecordFile_no_auth @1624 + uFR_int_DesfireCreateCyclicRecordFile_no_authM @1625 + uFR_int_DesfireCreateDesApplication_2k3des @1626 + uFR_int_DesfireCreateDesApplication_2k3desM @1627 + uFR_int_DesfireCreateDesApplication_2k3des_PK @1628 + uFR_int_DesfireCreateDesApplication_2k3des_PK_M @1629 + uFR_int_DesfireCreateDesApplication_2k3des_iso @1630 + uFR_int_DesfireCreateDesApplication_2k3des_isoM @1631 + uFR_int_DesfireCreateDesApplication_2k3des_iso_PK @1632 + uFR_int_DesfireCreateDesApplication_2k3des_iso_PK_M @1633 + uFR_int_DesfireCreateDesApplication_3k3des @1634 + uFR_int_DesfireCreateDesApplication_3k3desM @1635 + uFR_int_DesfireCreateDesApplication_3k3des_PK @1636 + uFR_int_DesfireCreateDesApplication_3k3des_PK_M @1637 + uFR_int_DesfireCreateDesApplication_3k3des_iso @1638 + uFR_int_DesfireCreateDesApplication_3k3des_isoM @1639 + uFR_int_DesfireCreateDesApplication_3k3des_iso_PK @1640 + uFR_int_DesfireCreateDesApplication_3k3des_iso_PK_M @1641 + uFR_int_DesfireCreateDesApplication_aes @1642 + uFR_int_DesfireCreateDesApplication_aesM @1643 + uFR_int_DesfireCreateDesApplication_aes_PK @1644 + uFR_int_DesfireCreateDesApplication_aes_PK_M @1645 + uFR_int_DesfireCreateDesApplication_aes_iso @1646 + uFR_int_DesfireCreateDesApplication_aes_isoM @1647 + uFR_int_DesfireCreateDesApplication_aes_iso_PK @1648 + uFR_int_DesfireCreateDesApplication_aes_iso_PK_M @1649 + uFR_int_DesfireCreateDesApplication_des @1650 + uFR_int_DesfireCreateDesApplication_desM @1651 + uFR_int_DesfireCreateDesApplication_des_PK @1652 + uFR_int_DesfireCreateDesApplication_des_PK_M @1653 + uFR_int_DesfireCreateDesApplication_des_iso @1654 + uFR_int_DesfireCreateDesApplication_des_isoM @1655 + uFR_int_DesfireCreateDesApplication_des_iso_PK @1656 + uFR_int_DesfireCreateDesApplication_des_iso_PK_M @1657 + uFR_int_DesfireCreateDesApplication_no_auth @1658 + uFR_int_DesfireCreateDesApplication_no_auth_M @1659 + uFR_int_DesfireCreateDesApplication_no_auth_iso @1660 + uFR_int_DesfireCreateDesApplication_no_auth_isoM @1661 + uFR_int_DesfireCreateLinearRecordFile_2k3des @1662 + uFR_int_DesfireCreateLinearRecordFile_2k3desM @1663 + uFR_int_DesfireCreateLinearRecordFile_2k3des_PK @1664 + uFR_int_DesfireCreateLinearRecordFile_2k3des_PK_M @1665 + uFR_int_DesfireCreateLinearRecordFile_3k3des @1666 + uFR_int_DesfireCreateLinearRecordFile_3k3desM @1667 + uFR_int_DesfireCreateLinearRecordFile_3k3des_PK @1668 + uFR_int_DesfireCreateLinearRecordFile_3k3des_PK_M @1669 + uFR_int_DesfireCreateLinearRecordFile_aes @1670 + uFR_int_DesfireCreateLinearRecordFile_aesM @1671 + uFR_int_DesfireCreateLinearRecordFile_aes_PK @1672 + uFR_int_DesfireCreateLinearRecordFile_aes_PK_M @1673 + uFR_int_DesfireCreateLinearRecordFile_des @1674 + uFR_int_DesfireCreateLinearRecordFile_desM @1675 + uFR_int_DesfireCreateLinearRecordFile_des_PK @1676 + uFR_int_DesfireCreateLinearRecordFile_des_PK_M @1677 + uFR_int_DesfireCreateLinearRecordFile_no_auth @1678 + uFR_int_DesfireCreateLinearRecordFile_no_authM @1679 + uFR_int_DesfireCreateStdDataFile @1680 + uFR_int_DesfireCreateStdDataFileM @1681 + uFR_int_DesfireCreateStdDataFile_2k3des @1682 + uFR_int_DesfireCreateStdDataFile_2k3desM @1683 + uFR_int_DesfireCreateStdDataFile_2k3des_PK @1684 + uFR_int_DesfireCreateStdDataFile_2k3des_PK_M @1685 + uFR_int_DesfireCreateStdDataFile_2k3des_iso @1686 + uFR_int_DesfireCreateStdDataFile_2k3des_isoM @1687 + uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK @1688 + uFR_int_DesfireCreateStdDataFile_2k3des_iso_PK_M @1689 + uFR_int_DesfireCreateStdDataFile_3k3des @1690 + uFR_int_DesfireCreateStdDataFile_3k3desM @1691 + uFR_int_DesfireCreateStdDataFile_3k3des_PK @1692 + uFR_int_DesfireCreateStdDataFile_3k3des_PK_M @1693 + uFR_int_DesfireCreateStdDataFile_3k3des_iso @1694 + uFR_int_DesfireCreateStdDataFile_3k3des_isoM @1695 + uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK @1696 + uFR_int_DesfireCreateStdDataFile_3k3des_iso_PK_M @1697 + uFR_int_DesfireCreateStdDataFile_PK @1698 + uFR_int_DesfireCreateStdDataFile_PK_M @1699 + uFR_int_DesfireCreateStdDataFile_aes @1700 + uFR_int_DesfireCreateStdDataFile_aesM @1701 + uFR_int_DesfireCreateStdDataFile_aes_PK @1702 + uFR_int_DesfireCreateStdDataFile_aes_PK_M @1703 + uFR_int_DesfireCreateStdDataFile_aes_iso @1704 + uFR_int_DesfireCreateStdDataFile_aes_isoM @1705 + uFR_int_DesfireCreateStdDataFile_aes_iso_PK @1706 + uFR_int_DesfireCreateStdDataFile_aes_iso_PK_M @1707 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm @1708 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdmM @1709 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK @1710 + uFR_int_DesfireCreateStdDataFile_aes_iso_sdm_PK_M @1711 + uFR_int_DesfireCreateStdDataFile_des @1712 + uFR_int_DesfireCreateStdDataFile_desM @1713 + uFR_int_DesfireCreateStdDataFile_des_PK @1714 + uFR_int_DesfireCreateStdDataFile_des_PK_M @1715 + uFR_int_DesfireCreateStdDataFile_des_iso @1716 + uFR_int_DesfireCreateStdDataFile_des_isoM @1717 + uFR_int_DesfireCreateStdDataFile_des_iso_PK @1718 + uFR_int_DesfireCreateStdDataFile_des_iso_PK_M @1719 + uFR_int_DesfireCreateStdDataFile_no_auth @1720 + uFR_int_DesfireCreateStdDataFile_no_auth_M @1721 + uFR_int_DesfireCreateStdDataFile_no_auth_iso @1722 + uFR_int_DesfireCreateStdDataFile_no_auth_isoM @1723 + uFR_int_DesfireCreateTransMacFile_2k3des @1724 + uFR_int_DesfireCreateTransMacFile_2k3des_M @1725 + uFR_int_DesfireCreateTransMacFile_2k3des_PK @1726 + uFR_int_DesfireCreateTransMacFile_2k3des_PK_M @1727 + uFR_int_DesfireCreateTransMacFile_3k3des @1728 + uFR_int_DesfireCreateTransMacFile_3k3des_M @1729 + uFR_int_DesfireCreateTransMacFile_3k3des_PK @1730 + uFR_int_DesfireCreateTransMacFile_3k3des_PK_M @1731 + uFR_int_DesfireCreateTransMacFile_aes @1732 + uFR_int_DesfireCreateTransMacFile_aes_M @1733 + uFR_int_DesfireCreateTransMacFile_aes_PK @1734 + uFR_int_DesfireCreateTransMacFile_aes_PK_M @1735 + uFR_int_DesfireCreateTransMacFile_des @1736 + uFR_int_DesfireCreateTransMacFile_des_M @1737 + uFR_int_DesfireCreateTransMacFile_des_PK @1738 + uFR_int_DesfireCreateTransMacFile_des_PK_M @1739 + uFR_int_DesfireCreateValueFile @1740 + uFR_int_DesfireCreateValueFileM @1741 + uFR_int_DesfireCreateValueFile_2k3des @1742 + uFR_int_DesfireCreateValueFile_2k3desM @1743 + uFR_int_DesfireCreateValueFile_2k3des_PK @1744 + uFR_int_DesfireCreateValueFile_2k3des_PK_M @1745 + uFR_int_DesfireCreateValueFile_3k3des @1746 + uFR_int_DesfireCreateValueFile_3k3desM @1747 + uFR_int_DesfireCreateValueFile_3k3des_PK @1748 + uFR_int_DesfireCreateValueFile_3k3des_PK_M @1749 + uFR_int_DesfireCreateValueFile_PK @1750 + uFR_int_DesfireCreateValueFile_PK_M @1751 + uFR_int_DesfireCreateValueFile_aes @1752 + uFR_int_DesfireCreateValueFile_aesM @1753 + uFR_int_DesfireCreateValueFile_aes_PK @1754 + uFR_int_DesfireCreateValueFile_aes_PK_M @1755 + uFR_int_DesfireCreateValueFile_des @1756 + uFR_int_DesfireCreateValueFile_desM @1757 + uFR_int_DesfireCreateValueFile_des_PK @1758 + uFR_int_DesfireCreateValueFile_des_PK_M @1759 + uFR_int_DesfireCreateValueFile_no_auth @1760 + uFR_int_DesfireCreateValueFile_no_auth_M @1761 + uFR_int_DesfireDecreaseValueFile @1762 + uFR_int_DesfireDecreaseValueFileM @1763 + uFR_int_DesfireDecreaseValueFile_2k3des @1764 + uFR_int_DesfireDecreaseValueFile_2k3desM @1765 + uFR_int_DesfireDecreaseValueFile_2k3des_PK @1766 + uFR_int_DesfireDecreaseValueFile_2k3des_PK_M @1767 + uFR_int_DesfireDecreaseValueFile_3k3des @1768 + uFR_int_DesfireDecreaseValueFile_3k3desM @1769 + uFR_int_DesfireDecreaseValueFile_3k3des_PK @1770 + uFR_int_DesfireDecreaseValueFile_3k3des_PK_M @1771 + uFR_int_DesfireDecreaseValueFile_PK @1772 + uFR_int_DesfireDecreaseValueFile_PK_M @1773 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des @1774 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3desM @1775 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK @1776 + uFR_int_DesfireDecreaseValueFile_TransMac_2k3des_PK_M @1777 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des @1778 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3desM @1779 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK @1780 + uFR_int_DesfireDecreaseValueFile_TransMac_3k3des_PK_M @1781 + uFR_int_DesfireDecreaseValueFile_TransMac_aes @1782 + uFR_int_DesfireDecreaseValueFile_TransMac_aesM @1783 + uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK @1784 + uFR_int_DesfireDecreaseValueFile_TransMac_aes_PK_M @1785 + uFR_int_DesfireDecreaseValueFile_TransMac_des @1786 + uFR_int_DesfireDecreaseValueFile_TransMac_desM @1787 + uFR_int_DesfireDecreaseValueFile_TransMac_des_PK @1788 + uFR_int_DesfireDecreaseValueFile_TransMac_des_PK_M @1789 + uFR_int_DesfireDecreaseValueFile_TransMac_no_auth @1790 + uFR_int_DesfireDecreaseValueFile_TransMac_no_auth_M @1791 + uFR_int_DesfireDecreaseValueFile_aes @1792 + uFR_int_DesfireDecreaseValueFile_aesM @1793 + uFR_int_DesfireDecreaseValueFile_aes_PK @1794 + uFR_int_DesfireDecreaseValueFile_aes_PK_M @1795 + uFR_int_DesfireDecreaseValueFile_des @1796 + uFR_int_DesfireDecreaseValueFile_desM @1797 + uFR_int_DesfireDecreaseValueFile_des_PK @1798 + uFR_int_DesfireDecreaseValueFile_des_PK_M @1799 + uFR_int_DesfireDecreaseValueFile_no_auth @1800 + uFR_int_DesfireDecreaseValueFile_no_auth_M @1801 + uFR_int_DesfireDeleteApplication @1802 + uFR_int_DesfireDeleteApplicationM @1803 + uFR_int_DesfireDeleteApplication_2k3des @1804 + uFR_int_DesfireDeleteApplication_2k3desM @1805 + uFR_int_DesfireDeleteApplication_2k3des_PK @1806 + uFR_int_DesfireDeleteApplication_2k3des_PK_M @1807 + uFR_int_DesfireDeleteApplication_3k3des @1808 + uFR_int_DesfireDeleteApplication_3k3desM @1809 + uFR_int_DesfireDeleteApplication_3k3des_PK @1810 + uFR_int_DesfireDeleteApplication_3k3des_PK_M @1811 + uFR_int_DesfireDeleteApplication_PK @1812 + uFR_int_DesfireDeleteApplication_PK_M @1813 + uFR_int_DesfireDeleteApplication_aes @1814 + uFR_int_DesfireDeleteApplication_aesM @1815 + uFR_int_DesfireDeleteApplication_aes_PK @1816 + uFR_int_DesfireDeleteApplication_aes_PK_M @1817 + uFR_int_DesfireDeleteApplication_app_master_2k3des @1818 + uFR_int_DesfireDeleteApplication_app_master_2k3desM @1819 + uFR_int_DesfireDeleteApplication_app_master_2k3des_PK @1820 + uFR_int_DesfireDeleteApplication_app_master_2k3des_PK_M @1821 + uFR_int_DesfireDeleteApplication_app_master_3k3des @1822 + uFR_int_DesfireDeleteApplication_app_master_3k3desM @1823 + uFR_int_DesfireDeleteApplication_app_master_3k3des_PK @1824 + uFR_int_DesfireDeleteApplication_app_master_3k3des_PK_M @1825 + uFR_int_DesfireDeleteApplication_app_master_PK @1826 + uFR_int_DesfireDeleteApplication_app_master_aes @1827 + uFR_int_DesfireDeleteApplication_app_master_aesM @1828 + uFR_int_DesfireDeleteApplication_app_master_aes_PK @1829 + uFR_int_DesfireDeleteApplication_app_master_aes_PK_M @1830 + uFR_int_DesfireDeleteApplication_app_master_des @1831 + uFR_int_DesfireDeleteApplication_app_master_desM @1832 + uFR_int_DesfireDeleteApplication_app_master_des_PK @1833 + uFR_int_DesfireDeleteApplication_app_master_des_PK_M @1834 + uFR_int_DesfireDeleteApplication_des @1835 + uFR_int_DesfireDeleteApplication_desM @1836 + uFR_int_DesfireDeleteApplication_des_PK @1837 + uFR_int_DesfireDeleteApplication_des_PK_M @1838 + uFR_int_DesfireDeleteFile @1839 + uFR_int_DesfireDeleteFileM @1840 + uFR_int_DesfireDeleteFile_2k3des @1841 + uFR_int_DesfireDeleteFile_2k3desM @1842 + uFR_int_DesfireDeleteFile_2k3des_PK @1843 + uFR_int_DesfireDeleteFile_2k3des_PK_M @1844 + uFR_int_DesfireDeleteFile_3k3des @1845 + uFR_int_DesfireDeleteFile_3k3desM @1846 + uFR_int_DesfireDeleteFile_3k3des_PK @1847 + uFR_int_DesfireDeleteFile_3k3des_PK_M @1848 + uFR_int_DesfireDeleteFile_PK @1849 + uFR_int_DesfireDeleteFile_PK_M @1850 + uFR_int_DesfireDeleteFile_aes @1851 + uFR_int_DesfireDeleteFile_aesM @1852 + uFR_int_DesfireDeleteFile_aes_PK @1853 + uFR_int_DesfireDeleteFile_aes_PK_M @1854 + uFR_int_DesfireDeleteFile_des @1855 + uFR_int_DesfireDeleteFile_desM @1856 + uFR_int_DesfireDeleteFile_des_PK @1857 + uFR_int_DesfireDeleteFile_des_PK_M @1858 + uFR_int_DesfireDeleteFile_no_auth @1859 + uFR_int_DesfireDeleteFile_no_auth_M @1860 + uFR_int_DesfireFormatCard @1861 + uFR_int_DesfireFormatCardM @1862 + uFR_int_DesfireFormatCard_2k3des @1863 + uFR_int_DesfireFormatCard_2k3desM @1864 + uFR_int_DesfireFormatCard_2k3des_PK @1865 + uFR_int_DesfireFormatCard_2k3des_PK_M @1866 + uFR_int_DesfireFormatCard_3k3des @1867 + uFR_int_DesfireFormatCard_3k3desM @1868 + uFR_int_DesfireFormatCard_3k3des_PK @1869 + uFR_int_DesfireFormatCard_3k3des_PK_M @1870 + uFR_int_DesfireFormatCard_PK @1871 + uFR_int_DesfireFormatCard_PK_M @1872 + uFR_int_DesfireFormatCard_aes @1873 + uFR_int_DesfireFormatCard_aesM @1874 + uFR_int_DesfireFormatCard_aes_PK @1875 + uFR_int_DesfireFormatCard_aes_PK_M @1876 + uFR_int_DesfireFormatCard_des @1877 + uFR_int_DesfireFormatCard_desM @1878 + uFR_int_DesfireFormatCard_des_PK @1879 + uFR_int_DesfireFormatCard_des_PK_M @1880 + uFR_int_DesfireFreeMem @1881 + uFR_int_DesfireFreeMemM @1882 + uFR_int_DesfireGetApplicationIds @1883 + uFR_int_DesfireGetApplicationIdsM @1884 + uFR_int_DesfireGetApplicationIds_2k3des @1885 + uFR_int_DesfireGetApplicationIds_2k3desM @1886 + uFR_int_DesfireGetApplicationIds_2k3des_PK @1887 + uFR_int_DesfireGetApplicationIds_2k3des_PK_M @1888 + uFR_int_DesfireGetApplicationIds_3k3des @1889 + uFR_int_DesfireGetApplicationIds_3k3desM @1890 + uFR_int_DesfireGetApplicationIds_3k3des_PK @1891 + uFR_int_DesfireGetApplicationIds_3k3des_PK_M @1892 + uFR_int_DesfireGetApplicationIds_PK @1893 + uFR_int_DesfireGetApplicationIds_PK_M @1894 + uFR_int_DesfireGetApplicationIds_aes @1895 + uFR_int_DesfireGetApplicationIds_aesM @1896 + uFR_int_DesfireGetApplicationIds_aes_PK @1897 + uFR_int_DesfireGetApplicationIds_aes_PK_M @1898 + uFR_int_DesfireGetApplicationIds_des @1899 + uFR_int_DesfireGetApplicationIds_desM @1900 + uFR_int_DesfireGetApplicationIds_des_PK @1901 + uFR_int_DesfireGetApplicationIds_des_PK_M @1902 + uFR_int_DesfireGetApplicationIds_no_auth @1903 + uFR_int_DesfireGetApplicationIds_no_auth_M @1904 + uFR_int_DesfireGetFileSettingsSdm_aes @1905 + uFR_int_DesfireGetFileSettingsSdm_aes_M @1906 + uFR_int_DesfireGetFileSettingsSdm_aes_PK @1907 + uFR_int_DesfireGetFileSettingsSdm_aes_PK_M @1908 + uFR_int_DesfireGetFileSettings_2k3des @1909 + uFR_int_DesfireGetFileSettings_2k3des_M @1910 + uFR_int_DesfireGetFileSettings_2k3des_PK @1911 + uFR_int_DesfireGetFileSettings_2k3des_PK_M @1912 + uFR_int_DesfireGetFileSettings_3k3des @1913 + uFR_int_DesfireGetFileSettings_3k3des_M @1914 + uFR_int_DesfireGetFileSettings_3k3des_PK @1915 + uFR_int_DesfireGetFileSettings_3k3des_PK_M @1916 + uFR_int_DesfireGetFileSettings_aes @1917 + uFR_int_DesfireGetFileSettings_aes_M @1918 + uFR_int_DesfireGetFileSettings_aes_PK @1919 + uFR_int_DesfireGetFileSettings_aes_PK_M @1920 + uFR_int_DesfireGetFileSettings_des @1921 + uFR_int_DesfireGetFileSettings_des_M @1922 + uFR_int_DesfireGetFileSettings_des_PK @1923 + uFR_int_DesfireGetFileSettings_des_PK_M @1924 + uFR_int_DesfireGetFileSettings_no_auth @1925 + uFR_int_DesfireGetFileSettings_no_auth_M @1926 + uFR_int_DesfireGetKeySettings @1927 + uFR_int_DesfireGetKeySettingsM @1928 + uFR_int_DesfireGetKeySettings_2k3des @1929 + uFR_int_DesfireGetKeySettings_2k3desM @1930 + uFR_int_DesfireGetKeySettings_2k3des_PK @1931 + uFR_int_DesfireGetKeySettings_2k3des_PK_M @1932 + uFR_int_DesfireGetKeySettings_3k3des @1933 + uFR_int_DesfireGetKeySettings_3k3desM @1934 + uFR_int_DesfireGetKeySettings_3k3des_PK @1935 + uFR_int_DesfireGetKeySettings_3k3des_PK_M @1936 + uFR_int_DesfireGetKeySettings_PK @1937 + uFR_int_DesfireGetKeySettings_PK_M @1938 + uFR_int_DesfireGetKeySettings_aes @1939 + uFR_int_DesfireGetKeySettings_aesM @1940 + uFR_int_DesfireGetKeySettings_aes_PK @1941 + uFR_int_DesfireGetKeySettings_aes_PK_M @1942 + uFR_int_DesfireGetKeySettings_des @1943 + uFR_int_DesfireGetKeySettings_desM @1944 + uFR_int_DesfireGetKeySettings_des_PK @1945 + uFR_int_DesfireGetKeySettings_des_PK_M @1946 + uFR_int_DesfireGetKeySettings_no_auth @1947 + uFR_int_DesfireGetKeySettings_no_auth_M @1948 + uFR_int_DesfireGetStdFileSize_2k3des @1949 + uFR_int_DesfireGetStdFileSize_2k3des_M @1950 + uFR_int_DesfireGetStdFileSize_2k3des_PK @1951 + uFR_int_DesfireGetStdFileSize_2k3des_PK_M @1952 + uFR_int_DesfireGetStdFileSize_3k3des @1953 + uFR_int_DesfireGetStdFileSize_3k3des_M @1954 + uFR_int_DesfireGetStdFileSize_3k3des_PK @1955 + uFR_int_DesfireGetStdFileSize_3k3des_PK_M @1956 + uFR_int_DesfireGetStdFileSize_aes @1957 + uFR_int_DesfireGetStdFileSize_aes_M @1958 + uFR_int_DesfireGetStdFileSize_aes_PK @1959 + uFR_int_DesfireGetStdFileSize_aes_PK_M @1960 + uFR_int_DesfireGetStdFileSize_des @1961 + uFR_int_DesfireGetStdFileSize_des_M @1962 + uFR_int_DesfireGetStdFileSize_des_PK @1963 + uFR_int_DesfireGetStdFileSize_des_PK_M @1964 + uFR_int_DesfireGetStdFileSize_no_auth @1965 + uFR_int_DesfireGetStdFileSize_no_auth_M @1966 + uFR_int_DesfireIncreaseValueFile @1967 + uFR_int_DesfireIncreaseValueFileM @1968 + uFR_int_DesfireIncreaseValueFile_2k3des @1969 + uFR_int_DesfireIncreaseValueFile_2k3desM @1970 + uFR_int_DesfireIncreaseValueFile_2k3des_PK @1971 + uFR_int_DesfireIncreaseValueFile_2k3des_PK_M @1972 + uFR_int_DesfireIncreaseValueFile_3k3des @1973 + uFR_int_DesfireIncreaseValueFile_3k3desM @1974 + uFR_int_DesfireIncreaseValueFile_3k3des_PK @1975 + uFR_int_DesfireIncreaseValueFile_3k3des_PK_M @1976 + uFR_int_DesfireIncreaseValueFile_PK @1977 + uFR_int_DesfireIncreaseValueFile_PK_M @1978 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des @1979 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3desM @1980 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK @1981 + uFR_int_DesfireIncreaseValueFile_TransMac_2k3des_PK_M @1982 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des @1983 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3desM @1984 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK @1985 + uFR_int_DesfireIncreaseValueFile_TransMac_3k3des_PK_M @1986 + uFR_int_DesfireIncreaseValueFile_TransMac_aes @1987 + uFR_int_DesfireIncreaseValueFile_TransMac_aesM @1988 + uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK @1989 + uFR_int_DesfireIncreaseValueFile_TransMac_aes_PK_M @1990 + uFR_int_DesfireIncreaseValueFile_TransMac_des @1991 + uFR_int_DesfireIncreaseValueFile_TransMac_desM @1992 + uFR_int_DesfireIncreaseValueFile_TransMac_des_PK @1993 + uFR_int_DesfireIncreaseValueFile_TransMac_des_PK_M @1994 + uFR_int_DesfireIncreaseValueFile_TransMac_no_auth @1995 + uFR_int_DesfireIncreaseValueFile_TransMac_no_auth_M @1996 + uFR_int_DesfireIncreaseValueFile_aes @1997 + uFR_int_DesfireIncreaseValueFile_aesM @1998 + uFR_int_DesfireIncreaseValueFile_aes_PK @1999 + uFR_int_DesfireIncreaseValueFile_aes_PK_M @2000 + uFR_int_DesfireIncreaseValueFile_des @2001 + uFR_int_DesfireIncreaseValueFile_desM @2002 + uFR_int_DesfireIncreaseValueFile_des_PK @2003 + uFR_int_DesfireIncreaseValueFile_des_PK_M @2004 + uFR_int_DesfireIncreaseValueFile_no_auth @2005 + uFR_int_DesfireIncreaseValueFile_no_auth_M @2006 + uFR_int_DesfireNDEFFormat @2007 + uFR_int_DesfireReadNDEFMessage @2008 + uFR_int_DesfireReadNDEFPayload @2009 + uFR_int_DesfireReadRecords_2k3des @2010 + uFR_int_DesfireReadRecords_2k3desM @2011 + uFR_int_DesfireReadRecords_2k3des_PK @2012 + uFR_int_DesfireReadRecords_2k3des_PK_M @2013 + uFR_int_DesfireReadRecords_3k3des @2014 + uFR_int_DesfireReadRecords_3k3desM @2015 + uFR_int_DesfireReadRecords_3k3des_PK @2016 + uFR_int_DesfireReadRecords_3k3des_PK_M @2017 + uFR_int_DesfireReadRecords_aes @2018 + uFR_int_DesfireReadRecords_aesM @2019 + uFR_int_DesfireReadRecords_aes_PK @2020 + uFR_int_DesfireReadRecords_aes_PK_M @2021 + uFR_int_DesfireReadRecords_des @2022 + uFR_int_DesfireReadRecords_desM @2023 + uFR_int_DesfireReadRecords_des_PK @2024 + uFR_int_DesfireReadRecords_des_PK_M @2025 + uFR_int_DesfireReadRecords_no_auth @2026 + uFR_int_DesfireReadRecords_no_authM @2027 + uFR_int_DesfireReadStdDataFile @2028 + uFR_int_DesfireReadStdDataFile_2k3des @2029 + uFR_int_DesfireReadStdDataFile_2k3desM @2030 + uFR_int_DesfireReadStdDataFile_2k3des_PK @2031 + uFR_int_DesfireReadStdDataFile_2k3des_PK_M @2032 + uFR_int_DesfireReadStdDataFile_3k3des @2033 + uFR_int_DesfireReadStdDataFile_3k3desM @2034 + uFR_int_DesfireReadStdDataFile_3k3des_PK @2035 + uFR_int_DesfireReadStdDataFile_3k3des_PK_M @2036 + uFR_int_DesfireReadStdDataFile_PK @2037 + uFR_int_DesfireReadStdDataFile_PK_M @2038 + uFR_int_DesfireReadStdDataFile_aes @2039 + uFR_int_DesfireReadStdDataFile_aesM @2040 + uFR_int_DesfireReadStdDataFile_aes_PK @2041 + uFR_int_DesfireReadStdDataFile_aes_PK_M @2042 + uFR_int_DesfireReadStdDataFile_des @2043 + uFR_int_DesfireReadStdDataFile_desM @2044 + uFR_int_DesfireReadStdDataFile_des_PK @2045 + uFR_int_DesfireReadStdDataFile_des_PK_M @2046 + uFR_int_DesfireReadStdDataFile_no_auth @2047 + uFR_int_DesfireReadStdDataFile_no_auth_M @2048 + uFR_int_DesfireReadStddDataFileM @2049 + uFR_int_DesfireReadStddDataFile_aesM @2050 + uFR_int_DesfireReadValueFile @2051 + uFR_int_DesfireReadValueFileM @2052 + uFR_int_DesfireReadValueFile_2k3des @2053 + uFR_int_DesfireReadValueFile_2k3desM @2054 + uFR_int_DesfireReadValueFile_2k3des_PK @2055 + uFR_int_DesfireReadValueFile_2k3des_PK_M @2056 + uFR_int_DesfireReadValueFile_3k3des @2057 + uFR_int_DesfireReadValueFile_3k3desM @2058 + uFR_int_DesfireReadValueFile_3k3des_PK @2059 + uFR_int_DesfireReadValueFile_3k3des_PK_M @2060 + uFR_int_DesfireReadValueFile_PK @2061 + uFR_int_DesfireReadValueFile_PK_M @2062 + uFR_int_DesfireReadValueFile_aes @2063 + uFR_int_DesfireReadValueFile_aesM @2064 + uFR_int_DesfireReadValueFile_aes_PK @2065 + uFR_int_DesfireReadValueFile_aes_PK_M @2066 + uFR_int_DesfireReadValueFile_des @2067 + uFR_int_DesfireReadValueFile_desM @2068 + uFR_int_DesfireReadValueFile_des_PK @2069 + uFR_int_DesfireReadValueFile_des_PK_M @2070 + uFR_int_DesfireReadValueFile_no_auth @2071 + uFR_int_DesfireReadValueFile_no_auth_M @2072 + uFR_int_DesfireRidReadECCSignature_2k3des @2073 + uFR_int_DesfireRidReadECCSignature_2k3desM @2074 + uFR_int_DesfireRidReadECCSignature_2k3des_PK @2075 + uFR_int_DesfireRidReadECCSignature_2k3des_PK_M @2076 + uFR_int_DesfireRidReadECCSignature_3k3des @2077 + uFR_int_DesfireRidReadECCSignature_3k3desM @2078 + uFR_int_DesfireRidReadECCSignature_3k3des_PK @2079 + uFR_int_DesfireRidReadECCSignature_3k3des_PK_M @2080 + uFR_int_DesfireRidReadECCSignature_aes @2081 + uFR_int_DesfireRidReadECCSignature_aesM @2082 + uFR_int_DesfireRidReadECCSignature_aes_PK @2083 + uFR_int_DesfireRidReadECCSignature_aes_PK_M @2084 + uFR_int_DesfireRidReadECCSignature_des @2085 + uFR_int_DesfireRidReadECCSignature_desM @2086 + uFR_int_DesfireRidReadECCSignature_des_PK @2087 + uFR_int_DesfireRidReadECCSignature_des_PK_M @2088 + uFR_int_DesfireSetConfiguration @2089 + uFR_int_DesfireSetConfigurationM @2090 + uFR_int_DesfireSetConfiguration_2k3des @2091 + uFR_int_DesfireSetConfiguration_2k3desM @2092 + uFR_int_DesfireSetConfiguration_2k3des_PK @2093 + uFR_int_DesfireSetConfiguration_2k3des_PK_M @2094 + uFR_int_DesfireSetConfiguration_3k3des @2095 + uFR_int_DesfireSetConfiguration_3k3desM @2096 + uFR_int_DesfireSetConfiguration_3k3des_PK @2097 + uFR_int_DesfireSetConfiguration_3k3des_PK_M @2098 + uFR_int_DesfireSetConfiguration_PK @2099 + uFR_int_DesfireSetConfiguration_PK_M @2100 + uFR_int_DesfireSetConfiguration_aes @2101 + uFR_int_DesfireSetConfiguration_aesM @2102 + uFR_int_DesfireSetConfiguration_aes_PK @2103 + uFR_int_DesfireSetConfiguration_aes_PK_M @2104 + uFR_int_DesfireSetConfiguration_des @2105 + uFR_int_DesfireSetConfiguration_desM @2106 + uFR_int_DesfireSetConfiguration_des_PK @2107 + uFR_int_DesfireSetConfiguration_des_PK_M @2108 + uFR_int_DesfireSetTransactionTimer_aes @2109 + uFR_int_DesfireSetTransactionTimer_aesM @2110 + uFR_int_DesfireSetTransactionTimer_aes_PK @2111 + uFR_int_DesfireSetTransactionTimer_aes_PK_M @2112 + uFR_int_DesfireUidReadECCSignature @2113 + uFR_int_DesfireUidReadECCSignatureM @2114 + uFR_int_DesfireWriteAesKey @2115 + uFR_int_DesfireWriteAesKeyM @2116 + uFR_int_DesfireWriteBackupDataFile_2k3des @2117 + uFR_int_DesfireWriteBackupDataFile_2k3desM @2118 + uFR_int_DesfireWriteBackupDataFile_2k3des_PK @2119 + uFR_int_DesfireWriteBackupDataFile_2k3des_PK_M @2120 + uFR_int_DesfireWriteBackupDataFile_3k3des @2121 + uFR_int_DesfireWriteBackupDataFile_3k3desM @2122 + uFR_int_DesfireWriteBackupDataFile_3k3des_PK @2123 + uFR_int_DesfireWriteBackupDataFile_3k3des_PK_M @2124 + uFR_int_DesfireWriteBackupDataFile_aes @2125 + uFR_int_DesfireWriteBackupDataFile_aesM @2126 + uFR_int_DesfireWriteBackupDataFile_aes_PK @2127 + uFR_int_DesfireWriteBackupDataFile_aes_PK_M @2128 + uFR_int_DesfireWriteBackupDataFile_des @2129 + uFR_int_DesfireWriteBackupDataFile_desM @2130 + uFR_int_DesfireWriteBackupDataFile_des_PK @2131 + uFR_int_DesfireWriteBackupDataFile_des_PK_M @2132 + uFR_int_DesfireWriteBackupDataFile_no_auth @2133 + uFR_int_DesfireWriteBackupDataFile_no_auth_M @2134 + uFR_int_DesfireWriteKey @2135 + uFR_int_DesfireWriteKeyM @2136 + uFR_int_DesfireWriteNDEFMessage @2137 + uFR_int_DesfireWriteNDEFPayload @2138 + uFR_int_DesfireWriteRecord_2k3des @2139 + uFR_int_DesfireWriteRecord_2k3desM @2140 + uFR_int_DesfireWriteRecord_2k3des_PK @2141 + uFR_int_DesfireWriteRecord_2k3des_PK_M @2142 + uFR_int_DesfireWriteRecord_3k3des @2143 + uFR_int_DesfireWriteRecord_3k3desM @2144 + uFR_int_DesfireWriteRecord_3k3des_PK @2145 + uFR_int_DesfireWriteRecord_3k3des_PK_M @2146 + uFR_int_DesfireWriteRecord_TransMac_2k3des @2147 + uFR_int_DesfireWriteRecord_TransMac_2k3desM @2148 + uFR_int_DesfireWriteRecord_TransMac_2k3des_PK @2149 + uFR_int_DesfireWriteRecord_TransMac_2k3des_PK_M @2150 + uFR_int_DesfireWriteRecord_TransMac_3k3des @2151 + uFR_int_DesfireWriteRecord_TransMac_3k3desM @2152 + uFR_int_DesfireWriteRecord_TransMac_3k3des_PK @2153 + uFR_int_DesfireWriteRecord_TransMac_3k3des_PK_M @2154 + uFR_int_DesfireWriteRecord_TransMac_aes @2155 + uFR_int_DesfireWriteRecord_TransMac_aesM @2156 + uFR_int_DesfireWriteRecord_TransMac_aes_PK @2157 + uFR_int_DesfireWriteRecord_TransMac_aes_PK_M @2158 + uFR_int_DesfireWriteRecord_TransMac_des @2159 + uFR_int_DesfireWriteRecord_TransMac_desM @2160 + uFR_int_DesfireWriteRecord_TransMac_des_PK @2161 + uFR_int_DesfireWriteRecord_TransMac_des_PK_M @2162 + uFR_int_DesfireWriteRecord_TransMac_no_auth @2163 + uFR_int_DesfireWriteRecord_TransMac_no_auth_M @2164 + uFR_int_DesfireWriteRecord_aes @2165 + uFR_int_DesfireWriteRecord_aesM @2166 + uFR_int_DesfireWriteRecord_aes_PK @2167 + uFR_int_DesfireWriteRecord_aes_PK_M @2168 + uFR_int_DesfireWriteRecord_des @2169 + uFR_int_DesfireWriteRecord_desM @2170 + uFR_int_DesfireWriteRecord_des_PK @2171 + uFR_int_DesfireWriteRecord_des_PK_M @2172 + uFR_int_DesfireWriteRecord_no_auth @2173 + uFR_int_DesfireWriteRecord_no_authM @2174 + uFR_int_DesfireWriteStdDataFile @2175 + uFR_int_DesfireWriteStdDataFileM @2176 + uFR_int_DesfireWriteStdDataFile_2k3des @2177 + uFR_int_DesfireWriteStdDataFile_2k3desM @2178 + uFR_int_DesfireWriteStdDataFile_2k3des_PK @2179 + uFR_int_DesfireWriteStdDataFile_2k3des_PK_M @2180 + uFR_int_DesfireWriteStdDataFile_3k3des @2181 + uFR_int_DesfireWriteStdDataFile_3k3desM @2182 + uFR_int_DesfireWriteStdDataFile_3k3des_PK @2183 + uFR_int_DesfireWriteStdDataFile_3k3des_PK_M @2184 + uFR_int_DesfireWriteStdDataFile_PK @2185 + uFR_int_DesfireWriteStdDataFile_PK_M @2186 + uFR_int_DesfireWriteStdDataFile_aes @2187 + uFR_int_DesfireWriteStdDataFile_aesM @2188 + uFR_int_DesfireWriteStdDataFile_aes_PK @2189 + uFR_int_DesfireWriteStdDataFile_aes_PK_M @2190 + uFR_int_DesfireWriteStdDataFile_des @2191 + uFR_int_DesfireWriteStdDataFile_desM @2192 + uFR_int_DesfireWriteStdDataFile_des_PK @2193 + uFR_int_DesfireWriteStdDataFile_des_PK_M @2194 + uFR_int_DesfireWriteStdDataFile_no_auth @2195 + uFR_int_DesfireWriteStdDataFile_no_auth_M @2196 + uFR_int_GetDesfireUid @2197 + uFR_int_GetDesfireUidM @2198 + uFR_int_GetDesfireUid_2k3des @2199 + uFR_int_GetDesfireUid_2k3desM @2200 + uFR_int_GetDesfireUid_2k3des_PK @2201 + uFR_int_GetDesfireUid_2k3des_PK_M @2202 + uFR_int_GetDesfireUid_3k3des @2203 + uFR_int_GetDesfireUid_3k3desM @2204 + uFR_int_GetDesfireUid_3k3des_PK @2205 + uFR_int_GetDesfireUid_3k3des_PK_M @2206 + uFR_int_GetDesfireUid_PK @2207 + uFR_int_GetDesfireUid_PK_M @2208 + uFR_int_GetDesfireUid_aes @2209 + uFR_int_GetDesfireUid_aesM @2210 + uFR_int_GetDesfireUid_aes_PK @2211 + uFR_int_GetDesfireUid_aes_PK_M @2212 + uFR_int_GetDesfireUid_des @2213 + uFR_int_GetDesfireUid_desM @2214 + uFR_int_GetDesfireUid_des_PK @2215 + uFR_int_GetDesfireUid_des_PK_M @2216 + uFR_mifare_desfire_aes_key_new_with_version @2217 + uFR_mifare_desfire_des_key_new @2218 + uFR_mifare_desfire_key_free @2219 + uFR_mifare_desfire_tag_free @2220 + uFR_mifare_desfire_tag_new @2221 + uart_transceive @2222 + uart_transceiveM @2223 + write_ndef_record @2224 + write_ndef_recordM @2225 + write_ndef_record_mirroring @2226 + write_ndef_record_mirroringM @2227 + write_ndef_record_mirroring_tt @2228 + write_ndef_record_mirroring_ttM @2229 diff --git a/lib/windows/x86_64/uFCoder-x86_64.dll b/lib/windows/x86_64/uFCoder-x86_64.dll new file mode 100644 index 0000000000000000000000000000000000000000..8af5b3afeb7720d93cc9c6e743c976867e52f655 Binary files /dev/null and b/lib/windows/x86_64/uFCoder-x86_64.dll differ